Ticket #3873: django.2.diff
File django.2.diff, 1.1 KB (added by , 18 years ago) |
---|
-
django/db/models/manipulators.py
242 242 243 243 def flatten_data(self): 244 244 new_data = {} 245 obj = self.change and self.original_object or None 245 if self.change: 246 obj = self.original_object 247 else: 248 obj = None 246 249 for f in self.opts.get_data_holders(self.follow): 247 250 fol = self.follow.get(f.name) 248 251 new_data.update(f.flatten_data(fol, obj)) -
django/db/models/fields/__init__.py
311 311 return self.get_choices() 312 312 313 313 def _get_val_from_obj(self, obj): 314 if obj :314 if obj is not None: 315 315 return getattr(obj, self.attname) 316 316 else: 317 317 return self.get_default()