diff options
author | Filipp Lepalaan <f@230.to> | 2013-05-13 16:58:09 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-05-13 16:58:09 +0300 |
commit | 8e3cdccde7d29a77e8227266c4986690f7dce10f (patch) | |
tree | ae5475f30b4af871025b9c500ac77fbe0c8227e6 /gsxws/core.py | |
parent | 8f8f0b513cfddb0f9aff1e3e18d49cbcd0f9fe0c (diff) | |
download | py-gsxws-8e3cdccde7d29a77e8227266c4986690f7dce10f.tar.gz py-gsxws-8e3cdccde7d29a77e8227266c4986690f7dce10f.tar.bz2 py-gsxws-8e3cdccde7d29a77e8227266c4986690f7dce10f.zip |
Fixing nesting in to_xml...
Diffstat (limited to 'gsxws/core.py')
-rw-r--r-- | gsxws/core.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gsxws/core.py b/gsxws/core.py index ffdc25d..5cd0261 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -331,14 +331,16 @@ class GsxObject(object): if isinstance(v, basestring): el.text = v if isinstance(v, dict): - v = GsxObject(**v) + for a, b in v.items(): + i = ET.SubElement(el, a) + i.text = b if isinstance(v, GsxObject): el.append(v.to_xml(k)) if isinstance(v, list): for e in v: if isinstance(e, GsxObject): el.append(e.to_xml(k)) - else: # assuming it's a dict... @TODO: make this nicer + else: # Assuming dict. @TODO: yuck... for a, b in e.items(): i = ET.SubElement(el, a) i.text = b |