OneToOne
This field is to represent the One To One relationship. Let's look at some methods this field allows.
- The interface of a field
OneToOne:
1 2 3 4 5 6 | |
- Parameters:
model: TheModelthat will be used in the relationship.name_constraint: The name of the attribute that will beFKin the other model.on_delete: Action ON DELETE:CASCADE,NO ACTION,RESTRICT,SET DEFAULTandSET NULL.on_update: Action ON UPDATE:CASCADE,NO ACTION,RESTRICT,SET DEFAULTandSET NULL.
Examples
Examples for these types of relationships can be found here