Python Forum

Full Version: What happens line by line after I register a model in django
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm new to programming and I don't really understand what's going on line by line in the code

For example: to register a model in Django, we can register the class “class Genre(models.Model)” and specify only one field, for example “models.Charfield.”

In turn, the parent class “Model(metaclass=ModelBase) (django.db.models.base)” contains about 50 methods. Most of them are private

Questions:
Were these 50 methods called when I registered the model?
If “yes”, which line of code is responsible for this call? Or which principle of OOP?
Could you recommend any article or book to delve into this topic?

Thanks in advance!
following the topic.