Ticket #1511: django_1511.diff
File django_1511.diff, 1.1 KB (added by , 18 years ago) |
---|
-
django/db/models/manipulators.py
109 109 if self.change: 110 110 self.fields_added, self.fields_changed, self.fields_deleted = [], [], [] 111 111 for f in self.opts.fields: 112 if not f.primary_key and str(getattr(self.original_object, f.attname)) != str(getattr(new_object, f.attname)): 112 if f.primary_key or getattr(f, 'auto_now', None) \ 113 or getattr(f, 'auto_now_add', None): 114 continue 115 newval = getattr(new_object, f.attname) 116 if type(newval) is bool: 117 cast = bool 118 else: 119 cast = str 120 if cast(getattr(self.original_object, f.attname)) != cast(newval): 113 121 self.fields_changed.append(f.verbose_name) 114 122 115 123 # Save many-to-many objects. Example: Set sites for a poll.