comparison gpp/forums/models.py @ 112:d1b0b86441c0

Forums: added a sync() function on the forum model. Created javascript for the moderate forum function to drive the master topic select checkbox.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Sep 2009 00:42:13 +0000
parents e94398f5e027
children d97ceb95ce02
comparison
equal deleted inserted replaced
111:e5faf9f0c11a 112:d1b0b86441c0
106 if self.post_count > 0: 106 if self.post_count > 0:
107 self.last_post = my_posts[self.post_count - 1] 107 self.last_post = my_posts[self.post_count - 1]
108 else: 108 else:
109 self.last_post = None 109 self.last_post = None
110 110
111 def sync(self):
112 """
113 Call to notify the forum that it needs to recompute its
114 denormalized fields.
115 """
116 self.topic_count_update()
117 self.post_count_update()
118
111 def last_post_pre_delete(self): 119 def last_post_pre_delete(self):
112 """ 120 """
113 Call this function prior to deleting the last post in the forum. 121 Call this function prior to deleting the last post in the forum.
114 A new last post will be found, if one exists. 122 A new last post will be found, if one exists.
115 This is to avoid the Django cascading delete issue. 123 This is to avoid the Django cascading delete issue.