Mercurial > public > sg101
comparison gpp/forums/models.py @ 393:9af6bd45c1f8
Another try at #191 after getting some good advice in a django-users thread.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 24 Mar 2011 00:15:34 +0000 |
parents | b15726767ab8 |
children | 42a4e66972d5 |
comparison
equal
deleted
inserted
replaced
392:79240675b903 | 393:9af6bd45c1f8 |
---|---|
200 bookmarkers = models.ManyToManyField(User, related_name='favorite_topics', | 200 bookmarkers = models.ManyToManyField(User, related_name='favorite_topics', |
201 verbose_name='bookmarkers', blank=True) | 201 verbose_name='bookmarkers', blank=True) |
202 | 202 |
203 # denormalized fields to reduce database hits | 203 # denormalized fields to reduce database hits |
204 post_count = models.IntegerField(blank=True, default=0) | 204 post_count = models.IntegerField(blank=True, default=0) |
205 update_date = models.DateTimeField() | 205 update_date = models.DateTimeField(db_index=True) |
206 last_post = models.OneToOneField('Post', blank=True, null=True, | 206 last_post = models.OneToOneField('Post', blank=True, null=True, |
207 related_name='parent_topic') | 207 related_name='parent_topic') |
208 | 208 |
209 class Meta: | 209 class Meta: |
210 ordering = ('-sticky', '-update_date', ) | 210 ordering = ('-sticky', '-update_date', ) |