Ticket #1064: onetoonefix.diff
File onetoonefix.diff, 698 bytes (added by , 19 years ago) |
---|
-
django/core/meta/__init__.py
1135 1135 # Handles setting many-to-many relationships. 1136 1136 # Example: Poll.set_sites() 1137 1137 def method_set_many_to_many(rel_field, self, id_list): 1138 current_ids = [ obj.idfor obj in method_get_many_to_many(rel_field, self)]1138 current_ids = [getattr(obj, obj._meta.pk.attname) for obj in method_get_many_to_many(rel_field, self)] 1139 1139 ids_to_add, ids_to_delete = dict([(i, 1) for i in id_list]), [] 1140 1140 for current_id in current_ids: 1141 1141 if current_id in id_list: