magic-removal: Fixed m2m set method

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Robert Wittams 2005-12-14 23:37:21 +00:00
parent 24c2187082
commit 2961e0cc58
1 changed files with 1 additions and 1 deletions

View File

@ -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.