Skip to main content
Loading page…
Python Mastery
Chapter 34
Lesson 2 of 4
Models & the ORM
Contents
Notes
Tutor
Note
Coming from SQLAlchemy? You Already Know Migrations
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
53 min
10 activities
0 of 10 done
In this lesson
1
Coming from SQLAlchemy? You Already Know Migrations
2
Models: Your Schema in Pure Python
3
Relationships: ForeignKey and ManyToManyField
4
Migrations: Evolving the Schema Safely
5
The QuerySet API in Action
6
F Objects and Q Objects
7
The N+1 Query Problem
8
QuerySet Mechanics Quiz
9
Migration Workflow Order
10
Senior Lab: Build, Run, and Review Evidence
Objectives
Define Django models with appropriate field types and relationships
Run makemigrations and migrate to evolve the database schema
Use the QuerySet API (all, filter, get, exclude, order_by, create, update, delete)
Use F objects, Q objects, and related-model lookups
Further reading
Django documentation
Chapter 34 · Django: The Batteries-Included Framework
Projects, Apps & the Request Lifecycle
Models & the ORM
The Admin & the Shell
Views, URLs, Templates & Forms
Previous: Projects, Apps & the Request Lifecycle
Next: The Admin & the Shell