summaryrefslogtreecommitdiffstats
path: root/askbot/management/commands/build_thread_summary_cache.py
blob: 854843fe954c1c65cf17733860a6ccf9781d83c8 (plain)
1
2
3
4
5
6
7
8
9
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()