comparison gpp/forums/models.py @ 181:500e5875a306

Implementing #61: adding a forum topic subscription feature.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Mar 2010 01:07:47 +0000
parents 6f14970b103a
children a5fcf3d1b663
comparison
equal deleted inserted replaced
180:aef00df91165 181:500e5875a306
170 creation_date = models.DateTimeField(auto_now_add=True) 170 creation_date = models.DateTimeField(auto_now_add=True)
171 user = models.ForeignKey(User) 171 user = models.ForeignKey(User)
172 view_count = models.IntegerField(blank=True, default=0) 172 view_count = models.IntegerField(blank=True, default=0)
173 sticky = models.BooleanField(blank=True, default=False) 173 sticky = models.BooleanField(blank=True, default=False)
174 locked = models.BooleanField(blank=True, default=False) 174 locked = models.BooleanField(blank=True, default=False)
175 subscribers = models.ManyToManyField(User, related_name='subscriptions',
176 verbose_name='subscribers', blank=True)
175 177
176 # denormalized fields to reduce database hits 178 # denormalized fields to reduce database hits
177 post_count = models.IntegerField(blank=True, default=0) 179 post_count = models.IntegerField(blank=True, default=0)
178 update_date = models.DateTimeField() 180 update_date = models.DateTimeField()
179 last_post = models.OneToOneField('Post', blank=True, null=True, 181 last_post = models.OneToOneField('Post', blank=True, null=True,