Permalink
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...
1 parent acdd24f commit de770472b146d6e01f507726cbf40d1c3ecb2cde @adrianholovaty adrianholovaty committed Nov 21, 2005
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)

0 comments on commit de77047

Please sign in to comment.