3.8 Putting It All Together
In Chapter 3, we saw how Django handles data. Django maps the Models of MVC (Model-View-Controller) directly on models, providing a way to organize and manipulate data.
Django models and model fields are simply Python classes. Django sets up very precise conventions, expecting class attributes of models to be instances of Django fields. Because Django is simply Python, however, developers can interact with models and fields just as they would with classes and attributes. Developers may in turn add methods to these models. What’s more, Django provides simple declarative syntax via field options and nested Meta classes to customize field and model behavior without needing to write complicated code.
By convention, Django ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access