Ticket #6745: manipulators.py.patch
File manipulators.py.patch, 820 bytes (added by , 17 years ago) |
---|
-
django/db/models/manipulators.py
diff -r 6531c7a99496 django/db/models/manipulators.py
a b class AutomaticManipulator(oldforms.Mani 124 124 else: 125 125 new_vals = new_data.getlist(f.name) 126 126 # First, clear the existing values. 127 rel_manager = getattr(new_object, f.name) 128 rel_manager.clear() 127 if self.change: 128 rel_manager = getattr(new_object, f.name) 129 rel_manager.clear() 129 130 # Then, set the new values. 130 131 for n in new_vals: 131 132 rel_manager.add(f.rel.to._default_manager.get(pk=n))