From 53c43fe54660090113a5b55b71b50ff84f68e335 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 13 May 2013 16:44:04 +0300 Subject: Fixing nesting in GsxObject to_xml --- gsxws/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gsxws') diff --git a/gsxws/core.py b/gsxws/core.py index 52d09c3..69149d2 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -335,10 +335,12 @@ class GsxObject(object): el.append(v.to_xml(k)) if isinstance(v, list): for e in v: - if isinstance(v, GsxObject): + if isinstance(e, GsxObject): el.append(e.to_xml(k)) - else: # assuming it's a dict... - el.append(GsxObject(**e).to_xml(k)) + else: # assuming it's a dict... @TODO: make this nicer + for a, b in e.items(): + i = ET.SubElement(el, a) + i.text = b return root -- cgit v1.2.3