Ticket #3849: onetoonefield-edit_inline.patch
File onetoonefield-edit_inline.patch, 999 bytes (added by , 18 years ago) |
---|
-
django/db/models/manipulators.py
162 162 # old to the new, to see which fields have changed. 163 163 old_rel_obj = None 164 164 if self.change: 165 if rel_new_data[related.opts.pk.name][0]: 165 from django.db.models.fields.related import OneToOneField 166 if isinstance(related.opts.pk,OneToOneField): 167 old_rel_obj = getattr(self.original_object, related.get_accessor_name()) 168 elif rel_new_data[related.opts.pk.name][0]: 166 169 try: 167 170 old_rel_obj = getattr(self.original_object, related.get_accessor_name()).get(**{'%s__exact' % related.opts.pk.name: rel_new_data[related.opts.pk.attname][0]}) 168 171 except ObjectDoesNotExist: