Move to src dir.
[edumed.git] / src / catalogue / management / commands / repackage.py
diff --git a/src/catalogue/management/commands/repackage.py b/src/catalogue/management/commands/repackage.py
new file mode 100755 (executable)
index 0000000..a2851f6
--- /dev/null
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# This file is part of EduMed, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from django.core.management.base import BaseCommand
+
+
+class Command(BaseCommand):
+    help = 'Rebuilds downloadable packages.'
+
+    def handle(self, **options):
+        from curriculum.models import Level
+
+        for level in Level.objects.all():
+            level.build_packages()