This is a reference to the file name?

Hi all, tell me.
django.db this is the name of the file, right?
and it looks like the class hierarchy models.Model?
like it would be easier to do
import django
class Musician(django.Models):


Or all these nuances built into the object and looks

models = {
Model : class Model():
.... ,
"Hello" : class Hello():
....
}


Help razrulit this moment.

from django.db import models

class Musician(models.Model):
 first_name = models.CharField(max_length=50)
 last_name = models.CharField(max_length=50)
 instrument = models.CharField(max_length=100)
June 7th 19 at 15:44
1 answer
June 7th 19 at 15:46
Solution
django, db , and models that the python modules.
Modules can be file and the folder with the file __init__.py inside.

Model is a class written in one of the files in the folder django/db/models/ and imported the file django/db/models/__init__.py
django.db is so written django/db ?

And where about this nuance you can read more or something in a search engine to drive below with examples of how you've described?
Model is a class written in one of the files in the folder django/db/models/ and imported the file django/db/models/__init__.py
- Ewell commented on June 7th 19 at 15:49
,

django.db is so written django/db ?


django/db/models so recorded the path of the file/folder in unix
- django.db.models so is written the path to the python module

And where about this nuance you can read more or something in a search engine to drive

you can read in python documentation that describes what is in the module of python. - Desiree.Fad commented on June 7th 19 at 15:52
tell me more please
class Musician(models.Model):
 first_name = models.CharField(max_length=50)

why, if we have a parent class called Model, and the model is the way to it, why it turns out that in our class we assign models.CharField(max_length=50)and not Model.CharField(max_length=50)? - Ewell commented on June 7th 19 at 15:55
, Model is a class that is described in the module model and a CharField is also a class described in this module.
It makes no sense to describe the class of the field (CharField) in the model class. So not "so" Model.CharField

Just look in the django source.
Now, what is in module django.db.models - Desiree.Fad commented on June 7th 19 at 15:58

Find more questions by tags Django