summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/contrib/comments/models.py5
1 files 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")