From de770472b146d6e01f507726cbf40d1c3ecb2cde Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 21 Nov 2005 00:05:18 +0000 Subject: [PATCH] Fixed #527 -- Changed method_get_related() to use rel.get_related_field() instead of rel.field_name git-svn-id: http://code.djangoproject.com/svn/django/trunk@1319 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index b61057662c..e6114449c1 100644 --- a/django/core/meta/__init__.py +++ b/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)