diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-02-13 04:42:40 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-02-13 04:42:40 -0300 |
commit | fa86b35b8adb2433ec792556c66be33a8d143dea (patch) | |
tree | e4180790580c5a59ff7f61fca86707a219e24422 | |
parent | f41a687731d8de40ed7be70a5fd37de96765ee4a (diff) | |
download | askbot-fa86b35b8adb2433ec792556c66be33a8d143dea.tar.gz askbot-fa86b35b8adb2433ec792556c66be33a8d143dea.tar.bz2 askbot-fa86b35b8adb2433ec792556c66be33a8d143dea.zip |
added management command to build cache for the thread summaries
-rw-r--r-- | askbot/doc/source/changelog.rst | 1 | ||||
-rw-r--r-- | askbot/management/commands/build_thread_summary_cache.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index ac809dce..39f3f22e 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -14,6 +14,7 @@ Development version (not released yet) amazon S3 for some reason adds weird expiration parameters (Evgeny) * Reduced memory usage in data migrations (Evgeny) * Added progress bars to slow data migrations (Evgeny) +* Added management command to rebuild cache summary for threads (Evgeny) 0.7.39 (Jan 11, 2012) --------------------- 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() |