~/talk

The Ins and Outs of Model Inheritance

Talkat DjangoCon US 2019 · 2019-09-22..09-27· [databases, python]
slides:none on file

Covers concrete claims and tradeoffs: Django supports abstract, multiple table inheritance causes up to n queries per record and proxy models with custom managers, plus alternatives like generic foreign keys and Postgres JSONField. Recommends composition over inheritance, shows a shopping cart and product examples, links to Django typed models and downcasting packages, and warns that JSON field stores unstructured data but is hard to query while proxy models use one table and change behavior via managers.

AI-written summary · about

  1. 0:00Introduction
  2. 1:16Composition vs Inheritance
  3. 2:52Composition in Django
  4. 3:38Abstract Models
  5. 4:42EOD Diagram
  6. 5:11Use Cases
  7. 7:00MultiTable Inheritance
  8. 14:08Down Casting
  9. 16:21Generic Foreign Keys
  10. 19:39Unstructured Data
  11. 22:15Explicit
  12. 23:25Outro
~/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.