Mercurial > public > sg101
diff gpp/forums/models.py @ 407:42a4e66972d5
Trying to fix #200; found a bug in the get_forum_unread_status() function. Added some db indexes.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 01 Apr 2011 01:18:44 +0000 |
parents | 9af6bd45c1f8 |
children | b1f939b1fb01 |
line wrap: on
line diff
--- a/gpp/forums/models.py Thu Mar 31 00:38:02 2011 +0000 +++ b/gpp/forums/models.py Fri Apr 01 01:18:44 2011 +0000 @@ -190,7 +190,7 @@ """ forum = models.ForeignKey(Forum, related_name='topics') name = models.CharField(max_length=255) - creation_date = models.DateTimeField(auto_now_add=True) + creation_date = models.DateTimeField(db_index=True) user = models.ForeignKey(User) view_count = models.IntegerField(blank=True, default=0) sticky = models.BooleanField(blank=True, default=False) @@ -371,7 +371,7 @@ """ user = models.ForeignKey(User) topic = models.ForeignKey(Topic) - last_visit = models.DateTimeField() + last_visit = models.DateTimeField(db_index=True) class Meta: unique_together = ('user', 'topic')