Ticket #1372: manipulators.py.patch

File manipulators.py.patch, 852 bytes (added by donald-curtis@…, 9 years ago)

The Patch File!

  • manipulators.py

     
    120120                        new_vals = new_data.get(f.name, ())
    121121                    else:
    122122                        new_vals = new_data.getlist(f.name)
    123                     was_changed = getattr(new_object, 'set_%s' % f.name)(new_vals)
     123                    was_changed = getattr(new_object, f.name).clear()
     124                    for n in new_vals:
     125                        m = f.rel.to.objects.get(pk=n)
     126                        getattr(new_object, f.name).add(m)
     127                    # was_changed = getattr(new_object, 'set_%s' % f.name)(new_vals)
    124128                    if self.change and was_changed:
    125129                        self.fields_changed.append(f.verbose_name)
    126130
Back to Top