Mercurial > public > sg101
diff gpp/comments/models.py @ 399:24f1230f3ee3
Fixing #193; reduce news query counts by grabbing tags and comment counts in bulk. Increased news items per page from 5 to 10.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 26 Mar 2011 03:08:05 +0000 |
parents | 254db4cb6a86 |
children |
line wrap: on
line diff
--- a/gpp/comments/models.py Sat Mar 26 00:26:00 2011 +0000 +++ b/gpp/comments/models.py Sat Mar 26 03:08:05 2011 +0000 @@ -31,7 +31,7 @@ class Comment(models.Model): """My own version of a Comment class that can attach comments to any other model.""" content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() + object_id = models.PositiveIntegerField(db_index=True) content_object = generic.GenericForeignKey('content_type', 'object_id') user = models.ForeignKey(User) comment = models.TextField(max_length=COMMENT_MAX_LENGTH)