A
A
alexse2016-01-28 20:14:29
Django
alexse, 2016-01-28 20:14:29

What is model.Models in Python/Django?

Good afternoon. I recently started learning Python and Django along the way.
Why is model.Models in brackets where the inherited class should be?
This point confuses me. What does she mean?
I did not find any information on this subject in the textbooks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kazmiruk, 2016-01-28
@kazmiruk

if we do this
from django.db.model import Model
then we write
class MyModel(Model):
....
if
from django.db import model
then
class MyModel(model.Model):
....

D
Denis Sh, 2016-01-28
@Deq56

pep8.ru/doc/tutorial-3.1/6.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question