add export lesson command
authorJan Szejko <janek37@gmail.com>
Wed, 26 Oct 2016 10:09:05 +0000 (12:09 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 26 Oct 2016 10:09:05 +0000 (12:09 +0200)
apps/catalogue/management/commands/export_lesson.py [new file with mode: 0644]

diff --git a/apps/catalogue/management/commands/export_lesson.py b/apps/catalogue/management/commands/export_lesson.py
new file mode 100644 (file)
index 0000000..a059698
--- /dev/null
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+
+from django.core.management.base import BaseCommand
+
+from catalogue.models import Book
+
+
+class Command(BaseCommand):
+    help = 'Exports a lesson in WL1 XML'
+    args = 'slug'
+
+    def handle(self, slug, *args, **options):
+        lesson = Book.objects.get(slug=slug)
+        print lesson.wl1_xml()
\ No newline at end of file