class ReverseOneToOneDescriptor: (source)
Accessor to the related object on the reverse side of a one-to-one relation. In the example:: class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant') ``Place.restaurant`` is a ``ReverseOneToOneDescriptor`` instance.
Method | __get__ |
Get the related instance through the reverse relation. |
Method | __init__ |
Undocumented |
Method | __reduce__ |
Undocumented |
Method | __set__ |
Set the related instance through the reverse relation. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | is |
Undocumented |
Instance Variable | related |
Undocumented |
Property |
|
Undocumented |
Get the related instance through the reverse relation. With the example above, when getting ``place.restaurant``: - ``self`` is the descriptor managing the ``restaurant`` attribute - ``instance`` is the ``place`` instance - ``cls`` is the ``Place`` class (unused) Keep in mind that ``Restaurant`` holds the foreign key to ``Place``.
Set the related instance through the reverse relation. With the example above, when setting ``place.restaurant = restaurant``: - ``self`` is the descriptor managing the ``restaurant`` attribute - ``instance`` is the ``place`` instance - ``value`` is the ``restaurant`` instance on the right of the equal sign Keep in mind that ``Restaurant`` holds the foreign key to ``Place``.