Ticket #3519: ticket3519.diff
File ticket3519.diff, 1.4 KB (added by , 18 years ago) |
---|
-
django/db/models/manipulators.py
160 160 # old to the new, to see which fields have changed. 161 161 old_rel_obj = None 162 162 if self.change: 163 if rel_new_data[related.opts.pk.name] [0]:163 if rel_new_data[related.opts.pk.name] and rel_new_data[related.opts.pk.name][0]: 164 164 try: 165 165 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]}) 166 166 except ObjectDoesNotExist: -
django/db/models/fields/__init__.py
284 284 Given the full new_data dictionary (from the manipulator), returns this 285 285 field's data. 286 286 """ 287 if rel :287 if rel and new_data.get(self.name, [self.get_default()]): 288 288 return new_data.get(self.name, [self.get_default()])[0] 289 289 val = new_data.get(self.name, self.get_default()) 290 290 if not self.empty_strings_allowed and val == '' and self.null: