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
: TheModel
that will be used in the relationship.name_constraint
: The name of the attribute that will beFK
in the other model.on_delete
: Action ON DELETE:CASCADE
,NO ACTION
,RESTRICT
,SET DEFAULT
andSET NULL
.on_update
: Action ON UPDATE:CASCADE
,NO ACTION
,RESTRICT
,SET DEFAULT
andSET NULL
.
Examples
Examples for these types of relationships can be found here