1 # -*- coding: utf-8 -*-
2 from django.forms import Form, CharField
4 from librarian import IOFile
5 from catalogue.models import Lesson
8 class LessonImportForm(Form):
9 lesson_xml = CharField()
11 def save(self, commit=True, **kwargs):
12 return Lesson.publish(IOFile.from_string(self.cleaned_data['lesson_xml']))