Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #527 -- Changed method_get_related() to use rel.get_related_fie…

…ld() instead of rel.field_name

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit de770472b146d6e01f507726cbf40d1c3ecb2cde 1 parent acdd24f
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/meta/__init__.py
View
2  django/core/meta/__init__.py
@@ -964,7 +964,7 @@ def method_get_related(method_name, rel_mod, rel_field, self, **kwargs):
if self._meta.has_related_links and rel_mod.Klass._meta.module_name == 'relatedlinks':
kwargs['object_id__exact'] = getattr(self, rel_field.rel.field_name)
else:
- kwargs['%s__%s__exact' % (rel_field.name, rel_field.rel.to.pk.name)] = getattr(self, rel_field.rel.field_name)
+ kwargs['%s__%s__exact' % (rel_field.name, rel_field.rel.to.pk.name)] = getattr(self, rel_field.rel.get_related_field().attname)
kwargs.update(rel_field.rel.lookup_overrides)
return getattr(rel_mod, method_name)(**kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.