Using relationships

With relational database management systems in picture, we can now define how two models relate to each other. The databases support the modeling of different kinds of relationships between the two models, such as:

  • One to One Relationships: These are the kind of relationships where a record from one model relates to only one record from another model. For example, a user in our user model has only one activation key mapped to it from our ActivationKey model. This is a one to one relationship.
  • One to Many Relationships: These are the kind of relationships where a record from one model maps to multiple records from another model. For example, if we have a model named Bug, describing the bug entries, then we can say, a user ...

Get Hands-On Enterprise Application Development with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.