OneToOneField for Profiles
Extend a model with a paired record.
Exactly One Each Way
Sometimes a row pairs with exactly one other row, both ways. That is a one-to-one relationship, perfect for splitting data cleanly.
The Profile Pattern
The classic use is a user profile: each user gets one profile, and each profile belongs to one user. Extra fields live separately.
All lessons in this course
- ForeignKey and on_delete
- ManyToManyField and Through Models
- OneToOneField for Profiles
- related_name and Reverse Lookups