From 2961e0cc584d6e4f5b292b973cef063b7ecd3d9a Mon Sep 17 00:00:00 2001 From: Robert Wittams Date: Wed, 14 Dec 2005 23:37:21 +0000 Subject: [PATCH] magic-removal: Fixed m2m set method git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1653 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py index fa5e8eb77d..2279f71639 100644 --- a/django/db/models/__init__.py +++ b/django/db/models/__init__.py @@ -1241,7 +1241,7 @@ class Model(object): # Handles related many-to-many object retrieval. # Examples: Album.get_song(), Album.get_song_list(), Album.get_song_count() def _get_related_many_to_many(self, method_name, rel_class, rel_field, **kwargs): - kwargs['%s__%s__exact' % (rel_field.name, rel_class._meta.pk.name)] = getattr(self, rel_class._meta.pk.attname) + kwargs['%s__%s__exact' % (rel_field.name, self._meta.pk.name)] = getattr(self, self._meta.pk.attname) return getattr(rel_class._default_manager, method_name)(**kwargs) # Handles setting many-to-many related objects.