Ticket #10157: 10157.diff
File 10157.diff, 920 bytes (added by , 16 years ago) |
---|
-
django/db/models/fields/related.py
210 210 (value, instance._meta.object_name, 211 211 self.related.get_accessor_name(), self.related.opts.object_name)) 212 212 213 # Set the value of the related field 214 setattr(value, self.related.field. rel.get_related_field().attname, instance)213 # Set the value of the related field to the value of the related object's related field 214 setattr(value, self.related.field.attname, getattr(instance, self.related.field.rel.get_related_field().attname)) 215 215 216 216 # Since we already know what the related object is, seed the related 217 217 # object caches now, too. This avoids another db hit if you get the