summaryrefslogtreecommitdiffstats
path: root/askbot/management/commands/build_thread_summary_cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/management/commands/build_thread_summary_cache.py')
-rw-r--r--askbot/management/commands/build_thread_summary_cache.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/askbot/management/commands/build_thread_summary_cache.py b/askbot/management/commands/build_thread_summary_cache.py
new file mode 100644
index 00000000..854843fe
--- /dev/null
+++ b/askbot/management/commands/build_thread_summary_cache.py
@@ -0,0 +1,10 @@
+from django.core.management.base import NoArgsCommand
+from askbot.models import Thread
+from askbot.utils.console import ProgressBar
+
+class Command(NoArgsCommand):
+ def handle_noargs(self, **options):
+ message = "Rebuilding thread summary cache"
+ count = Thread.objects.count()
+ for thread in ProgressBar(Thread.objects.iterator(), count, message):
+ thread.update_summary_html()