Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit cf7a078774dbcfa0fa2e286fd7907e15478d55d3 1 parent e545058
Malcolm Tredinnick authored September 01, 2008

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/contrib/comments/models.py
5  django/contrib/comments/models.py
@@ -16,9 +16,10 @@ class BaseCommentAbstractModel(models.Model):
16 16
     An abstract base class that any custom comment models probably should
17 17
     subclass.
18 18
     """
19  
-    
  19
+
20 20
     # Content-object field
21  
-    content_type   = models.ForeignKey(ContentType)
  21
+    content_type   = models.ForeignKey(ContentType,
  22
+            related_name="content_type_set_for_%(class)s")
22 23
     object_pk      = models.TextField(_('object ID'))
23 24
     content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk")
24 25
 

0 notes on commit cf7a078

Please sign in to comment.
Something went wrong with that request. Please try again.