mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
insert null values instead of empty attributes
This commit is contained in:
parent
eeba8ad2e4
commit
c1adcb93ee
@ -403,17 +403,17 @@ class CorpusFile(db.Model):
|
||||
self.dir, self.filename)
|
||||
element_tree = ET.parse(file)
|
||||
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('booktitle', self.booktitle)
|
||||
text_node.set('chapter', self.chapter)
|
||||
text_node.set('editor', self.editor)
|
||||
text_node.set('institution', self.institution)
|
||||
text_node.set('journal', self.journal)
|
||||
text_node.set('pages', self.pages)
|
||||
text_node.set('publisher', self.publisher)
|
||||
text_node.set('booktitle', self.booktitle if self.booktitle else "NULL")
|
||||
text_node.set('chapter', self.chapter if self.chapter else "NULL")
|
||||
text_node.set('editor', self.editor if self.editor else "NULL")
|
||||
text_node.set('institution', self.institution if self.institution else "NULL")
|
||||
text_node.set('journal', self.journal if self.journal else "NULL")
|
||||
text_node.set('pages', self.pages if self.pages else "NULL")
|
||||
text_node.set('publisher', self.publisher if self.publisher else "NULL")
|
||||
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)
|
||||
element_tree.write(file)
|
||||
self.corpus.status = 'unprepared'
|
||||
|
Loading…
Reference in New Issue
Block a user