Mighty Model Managers
summary
Model managers are presented as the concrete way to manage query logic: renaming defaults for readability (person.people.all), moving repeated filters into managers and QuerySet methods, and using QuerySet.as_manager (Django 1.7) to expose chainable operations like authors/editors and full-time/part-time. A soft‑delete pattern via an is_active field hides inactive rows by default, improving safety in a healthcare app where it ships and runs. Result: fewer duplicated queries, simpler tests, and composable caching and logging hooks.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 0:45Why are we here
- 1:46Why talk about model managers
- 2:34Show of hands
- 3:24Job of a Manager
- 4:07Sample Project
- 4:24No Big Deal
- 4:47Semantics
- 5:20Readability
- 5:38People
- 6:05Business Logic
- 7:12Subclass Manager
- 7:25Reference Manager
- 7:50Author Manager
- 8:09Query
- 9:25Model
- 10:09Employee Type
- 10:25FullTime PartTime
- 11:04PartTime Authors
- 12:00Preventing Mistakes
- 13:24Using Encapsulation
- 14:33One Caveat
- 16:27Query Sets
- 17:03Shoutouts
related talks
28mModel-View-Controller (MVC) through the ages and in Django
27mI never Meta model I didn't like...
26mA Related Matter: Optimizing your webapp
29mMaking smarter queries with advanced ORM resources
28mSaved you a click (or three): Supercharging the Django admin with actions and views
53mDjango: a Data Shovel With a Future
23mA different Form of navigation
01h 06mEffective Django
