Browse files

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
  • Loading branch information...
1 parent e545058 commit cf7a078774dbcfa0fa2e286fd7907e15478d55d3 @malcolmt malcolmt committed Sep 1, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/comments/models.py
View
5 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")

0 comments on commit cf7a078

Please sign in to comment.