Skip to content


Subversion checkout URL

You can clone with
Download ZIP
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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cf7a078774dbcfa0fa2e286fd7907e15478d55d3 1 parent e545058
@malcolmt malcolmt authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/comments/
5 django/contrib/comments/
@@ -16,9 +16,10 @@ class BaseCommentAbstractModel(models.Model):
An abstract base class that any custom comment models probably should
# 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.
Something went wrong with that request. Please try again.