I've always been using ForeignKeys.
+2
A:
A one-to-one relationship is a unique relation between two entities in both directions. I.e. for an entity A there exists only one entity B and vice versa.
The documentation says:
Conceptually, this is similar to a
ForeignKey
withunique=True
, but the "reverse" side of the relation will directly return a single object.This is most useful as the primary key of a model which "extends" another model in some way; Multi-table inheritance is implemented by adding an implicit one-to-one relation from the child model to the parent model, for example.
Felix Kling
2010-03-15 08:34:00