summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-01 17:56:22 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-01 17:56:22 +0000
commitcf7a078774dbcfa0fa2e286fd7907e15478d55d3 (patch)
tree7e8835c40a45a18b04c8ea744c235f6e878350f9 /django
parente545058ba94f5f5736a5db82e6ba5883d8071485 (diff)
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
Diffstat (limited to 'django')
-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")