Skip to content
Snippets Groups Projects
Commit c1adcb93 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

insert null values instead of empty attributes

parent eeba8ad2
No related branches found
No related tags found
No related merge requests found
...@@ -403,17 +403,17 @@ class CorpusFile(db.Model): ...@@ -403,17 +403,17 @@ class CorpusFile(db.Model):
self.dir, self.filename) self.dir, self.filename)
element_tree = ET.parse(file) element_tree = ET.parse(file)
text_node = element_tree.find('text') text_node = element_tree.find('text')
text_node.set('address', self.address) text_node.set('address', self.address if self.address else "NULL")
text_node.set('author', self.author) text_node.set('author', self.author)
text_node.set('booktitle', self.booktitle) text_node.set('booktitle', self.booktitle if self.booktitle else "NULL")
text_node.set('chapter', self.chapter) text_node.set('chapter', self.chapter if self.chapter else "NULL")
text_node.set('editor', self.editor) text_node.set('editor', self.editor if self.editor else "NULL")
text_node.set('institution', self.institution) text_node.set('institution', self.institution if self.institution else "NULL")
text_node.set('journal', self.journal) text_node.set('journal', self.journal if self.journal else "NULL")
text_node.set('pages', self.pages) text_node.set('pages', self.pages if self.pages else "NULL")
text_node.set('publisher', self.publisher) text_node.set('publisher', self.publisher if self.publisher else "NULL")
text_node.set('publishing_year', str(self.publishing_year)) text_node.set('publishing_year', str(self.publishing_year))
text_node.set('school', self.school) text_node.set('school', self.school if self.school else "NULL")
text_node.set('title', self.title) text_node.set('title', self.title)
element_tree.write(file) element_tree.write(file)
self.corpus.status = 'unprepared' self.corpus.status = 'unprepared'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment