WhisperMaPhone/thoughts/management/commands/update_html_content.py

12 lines
328 B
Python

from progressbar import progressbar
from django.core.management.base import BaseCommand
from thoughts.models import Thought
class Command(BaseCommand):
def handle(self, *args, **options):
for t in progressbar(Thought.objects.all()):
# Saving forces us to re-generate HTML content
t.save()