Apr-03-2022, 06:22 AM
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!
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!