diff 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
line wrap: on
line diff
--- a/gpp/forums/models.py	Mon Sep 28 03:57:09 2009 +0000
+++ b/gpp/forums/models.py	Wed Sep 30 00:42:13 2009 +0000
@@ -108,6 +108,14 @@
         else:
             self.last_post = None
 
+    def sync(self):
+        """
+        Call to notify the forum that it needs to recompute its
+        denormalized fields.
+        """
+        self.topic_count_update()
+        self.post_count_update()
+
     def last_post_pre_delete(self):
         """
         Call this function prior to deleting the last post in the forum.