movethreads.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from ... import attachments, 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()))
  15. self.start_timer()
  16. threads.move_mentions()
  17. self.stdout.write(
  18. self.style.SUCCESS("Moved mentions in %s" % self.stop_timer()))
  19. self.start_timer()
  20. threads.move_edits()
  21. self.stdout.write(
  22. self.style.SUCCESS("Moved edits histories in %s" % self.stop_timer()))
  23. self.start_timer()
  24. threads.move_likes()
  25. self.stdout.write(
  26. self.style.SUCCESS("Moved likes in %s" % self.stop_timer()))
  27. self.start_timer()
  28. attachments.move_attachments(self.stdout, self.style)
  29. self.stdout.write(
  30. self.style.SUCCESS("Moved attachments in %s" % self.stop_timer()))