Ticket #1064: onetoonefix.diff

File onetoonefix.diff, 698 bytes (added by bruce@…, 18 years ago)

Fix!

  • django/core/meta/__init__.py

     
    11351135# Handles setting many-to-many relationships.
    11361136# Example: Poll.set_sites()
    11371137def method_set_many_to_many(rel_field, self, id_list):
    1138     current_ids = [obj.id for 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)]
    11391139    ids_to_add, ids_to_delete = dict([(i, 1) for i in id_list]), []
    11401140    for current_id in current_ids:
    11411141        if current_id in id_list:
Back to Top