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