Django Cheatsheet 02 — Django ORM
Cheatsheet: filter/exclude, F/Q, select_related, prefetch_related, annotate.
Cheatsheet: filter/exclude, F/Q, select_related, prefetch_related, annotate.
Beyond the SQLAlchemy 2.0 basics: mapped types in depth, async sessions, hybrid properties, lazy/eager strategies, batched inserts, dataclass mixin, and the production patterns.
Why Drizzle is the right TypeScript ORM in 2026. Schema-first design, end-to-end type safety, drizzle-kit migrations, relations, transactions, JSON columns, and the patterns I reach for in production.
Build a production-ready FastAPI + SQLAlchemy 2.0 + PostgreSQL stack with async sessions, dependency-injected DB access, and Alembic migrations.
Everything I wish I’d known about the Django ORM earlier — how querysets really work, the N+1 problem, select_related vs prefetch_related, and the patterns that keep production code fast.
A tour of Django’s origin story, its ‘batteries included’ philosophy, the headline features, and where it shines (and where it doesn’t).