~/talk

One database table, one model, many behaviours: Proxy model

Talkat DjangoCon US 2023 · 2023-10-16..10-20· [python]
slides:none on file

Shows that Django proxy=True models reuse the same database table while giving different Python behaviors, demonstrated with Programmer/Doctor/JungleNut proxy classes. Uses a custom manager with a get_queryset filter to expose only specific roles, and override save to set type automatically. Applies to extending the base User and customizing the admin, and solves adding behavior to an existing production table without creating new tables, with working console examples and admin integration.

AI-written summary · about

  1. 0:00Introduction
  2. 2:34Model inheritance in Django
  3. 9:51Proxy models explained
  4. 14:17Model managers for queries
  5. 20:56Proxy model use cases
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.