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
This commit is contained in:
Malcolm Tredinnick 2008-09-01 17:56:22 +00:00
parent e545058ba9
commit cf7a078774
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,8 @@ class BaseCommentAbstractModel(models.Model):
""" """
# Content-object field # 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')) object_pk = models.TextField(_('object ID'))
content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk") content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk")