def __set__(self, instance, value):
        if instance is None:
            raise AttributeError, "%s must be accessed via instance" % self.related.opts.object_name
        # Set the value of the related field
        setattr(value, self.related.field.rel.get_related_field().attname, instance)

        # Clear the cache, if it exists
        try:
            delattr(value, self.related.field.get_cache_name())
        except __HOLE__:
            pass
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-0.96/django/db/models/fields/related.py/SingleRelatedObjectDescriptor.__set__