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:
parent
24c2187082
commit
2961e0cc58
|
@ -1241,7 +1241,7 @@ class Model(object):
|
||||||
# Handles related many-to-many object retrieval.
|
# Handles related many-to-many object retrieval.
|
||||||
# Examples: Album.get_song(), Album.get_song_list(), Album.get_song_count()
|
# 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):
|
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)
|
return getattr(rel_class._default_manager, method_name)(**kwargs)
|
||||||
|
|
||||||
# Handles setting many-to-many related objects.
|
# Handles setting many-to-many related objects.
|
||||||
|
|
Loading…
Reference in New Issue