movethreads.py 581 B

12345678910111213141516171819
  1. from ... import threads
  2. from ..base import BaseCommand
  3. class Command(BaseCommand):
  4. help = "Moves threads and posts from Misago 0.5"
  5. def handle(self, *args, **options):
  6. self.stdout.write("Moving threads from Misago 0.5:")
  7. self.start_timer()
  8. threads.move_threads(self.stdout, self.style)
  9. self.stdout.write(
  10. self.style.SUCCESS("Moved threads in %s" % self.stop_timer()))
  11. self.start_timer()
  12. threads.move_posts()
  13. self.stdout.write(
  14. self.style.SUCCESS("Moved posts in %s" % self.stop_timer()))