diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-01-15 06:10:02 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-01-15 06:10:02 +0000 |
| commit | e0af20fb0f172bad3c99e643f8b17d1870c4d512 (patch) | |
| tree | cc3d7ae9ca1828ade03b54b15e437ba033d03aae | |
| parent | 60e3d1352dc7330a39f92c81668f70efa29c2f94 (diff) | |
Fixed #1064 -- Fixed bug in set_many_to_many() for ManyToManyField pointing at a OneToOneField. Thanks, bruce@cubik.org and Luminosity
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/meta/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index dd048d4637..e458ba2272 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -1135,7 +1135,7 @@ def method_get_many_to_many(field_with_rel, self): # Handles setting many-to-many relationships. # Example: Poll.set_sites() def method_set_many_to_many(rel_field, self, id_list): - current_ids = [obj.id for obj in method_get_many_to_many(rel_field, self)] + current_ids = [getattr(obj, obj._meta.pk.attname) for obj in method_get_many_to_many(rel_field, self)] ids_to_add, ids_to_delete = dict([(i, 1) for i in id_list]), [] for current_id in current_ids: if current_id in id_list: |
