~/talk

I Didn't Know Querysets Could do That

Talkat DjangoCon US 2016 · 2016-07-17..07-22· [django]
links:none on file
slides:none on file

Shows concrete QuerySet recipes: use F() and Q() to build atomic, single‑SQL operations (e.g. Sum(F('unit_price') F('quantity'), output_field=FloatField()) to compute item totals), use select_related/prefetch_related to eliminate N+1 queries, use in_bulk* to get id→model maps, use only/defer to fetch fewer columns, use ExpressionWrapper and DB functions for inline transforms, and fall back to extra/raw SQL when native expressions can’t express the query. Examples run and avoid Python loops and race conditions.

AI-written summary · about

  1. 0:00Start
  2. 1:58REFERENCE MODELS
  3. 8:41EXAMPLE: OR QUERIES
  4. 10:46EXAMPLE: QUERY ARITHMETIC
  5. 12:48EXAMPLE: INLINE REFERENCES
  6. 14:02QUERY EXPRESSIONS
  7. 16:33EXAMPLE: ORDER TOTALS (REDUX)
  8. 18:38EXTRA
  9. 20:13LET'S RECAP
~/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.