- document = parser.WLDocument.from_string(file_contents)
-
- rdf_ns = dcparser.BookInfo.RDF
- dc_ns = dcparser.BookInfo.DC
-
- rdf_attrs = {rdf_ns('about'): form.cleaned_data.pop('about')}
- field_dict = {}
-
- for key, value in form.cleaned_data.items():
- field_dict[ dc_ns(key) ] = value if isinstance(value, list) else [value]
-
- print field_dict
-
- new_info = dcparser.BookInfo(rdf_attrs, field_dict)
- document.book_info = new_info
-
+ document = parser.WLDocument.from_string(file_contents)
+ document.book_info.update(form.cleaned_data)
+