From 084d618519b20e12526a9de54ba8ed62ea7959ac Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 22 Sep 2006 03:26:13 +0000 Subject: [PATCH] Fixed #2749 -- Get the correct m2m_reverse_name() in generic relations. Thanks to Jay Parlar and Chris Long for some good debugging here. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3787 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/fields/generic.py b/django/db/models/fields/generic.py index 5f4de40e696..7d7651029c4 100644 --- a/django/db/models/fields/generic.py +++ b/django/db/models/fields/generic.py @@ -117,7 +117,7 @@ class GenericRelation(RelatedField, Field): return self.object_id_field_name def m2m_reverse_name(self): - return self.model._meta.pk.attname + return self.object_id_field_name def contribute_to_class(self, cls, name): super(GenericRelation, self).contribute_to_class(cls, name)