From cf7a078774dbcfa0fa2e286fd7907e15478d55d3 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 1 Sep 2008 17:56:22 +0000 Subject: [PATCH] Added a related name to the ForeignKey in the abstract base class of the comment models. You'll never need to use this name, but it will lead to invalid models if not present. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8803 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/comments/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/contrib/comments/models.py b/django/contrib/comments/models.py index e9247dd133..3b785d6598 100644 --- a/django/contrib/comments/models.py +++ b/django/contrib/comments/models.py @@ -16,9 +16,10 @@ class BaseCommentAbstractModel(models.Model): An abstract base class that any custom comment models probably should subclass. """ - + # Content-object field - content_type = models.ForeignKey(ContentType) + content_type = models.ForeignKey(ContentType, + related_name="content_type_set_for_%(class)s") object_pk = models.TextField(_('object ID')) content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk")