24.2 Introduction to Chapter 24
While views are the heart of Django, many see the object-relational mapper (ORM) and the easy interaction with the database as Django’s most important features. Developers interact with the ORM almost as often as they do with views, and the process saves developers hours of work, so it’s no surprise such an emphasis is put on models, managers, and migrations.
Model managers are the main ORM tool developers interact with when handling data. We saw in Chapter 22: Overriding Django’s Authentication with a Custom User, how easy it is to add our own methods (createuser() and createsuperuser()) to managers, because they are simply Python classes. In this chapter, we see how to modify and change behavior, gaining greater ...
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