From 8e3cdccde7d29a77e8227266c4986690f7dce10f Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 13 May 2013 16:58:09 +0300 Subject: Fixing nesting in to_xml... --- gsxws/core.py | 6 ++++-- 1 file 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 -- cgit v1.2.3