class documentation

class ReverseOneToOneDescriptor: (source)

View In Hierarchy

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_prefetch_queryset Undocumented
Method get_queryset Undocumented
Method is_cached Undocumented
Instance Variable related Undocumented
Property RelatedObjectDoesNotExist Undocumented
def __get__(self, instance, cls=None): (source)

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``.

def __init__(self, related): (source)

Undocumented

def __reduce__(self): (source)

Undocumented

def __set__(self, instance, value): (source)

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``.

def get_prefetch_queryset(self, instances, queryset=None): (source)

Undocumented

def get_queryset(self, **hints): (source)

Undocumented

def is_cached(self, instance): (source)

Undocumented

Undocumented

@cached_property
RelatedObjectDoesNotExist = (source)

Undocumented