Contenido del Curso
Django ORM Ninja: Técnicas Avanzadas para Desarrolladores
Django ORM Ninja: Técnicas Avanzadas para Desarrolladores
One-to-One
A One-to-One relationship is used when one object of a model corresponds to exactly one object of another model. For example, a table of employees and another table of employee ID badges, where each employee has exactly one unique ID badge. To specify a One-to-One relation, use models.OneToOneField
.
OneToOneField accepts all of the extra arguments accepted by ForeignKey.
There is just example of usage One-to-One relations. We will not use it in our project.
You can learn more about this relation in the official documentation.
¡Gracias por tus comentarios!