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 ...
Get Django Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.