Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Colons are added somewhere in Django platform
  • Loading branch information
kthoden committed Jul 19, 2019
1 parent fb0b165 commit 9788ba9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion imxml2django.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2019-07-18 16:36:31 (kthoden)>
# Time-stamp: <2019-07-19 13:15:33 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -637,6 +637,14 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid
xmlDescription = etree.Element("EOAdescription")
xmlDescription.set("order", str(intObjectNumber))
xmlLabel = xmlElement.getchildren()[0]
label_children = xmlLabel.getchildren()
if label_children:
last_child = label_children[-1]
if last_child.tail.endswith(":"):
last_child.tail = last_child.tail[:-1]
else:
if xmlLabel.text.endswith(":"):
xmlLabel.text = xmlLabel.text[:-1]
xmlItem = xmlElement.getchildren()[1]
if len(xmlItem.getchildren()) > 0:
xmlContent = xmlItem.getchildren()[0]
Expand Down

0 comments on commit 9788ba9

Please sign in to comment.