[shared] Improvements to the XmlMarshaller and bugfix: Mixin.xml returns appy.Object instances correctly marshalled.

This commit is contained in:
Gaetan Delannay 2014-12-09 11:40:30 +01:00
parent 12836a40dc
commit b39c5553ea
3 changed files with 30 additions and 38 deletions

View file

@ -527,7 +527,9 @@ class BaseMixin:
methodRes.startswith('<?xml'): # Already XML
return methodRes
else:
res = XmlMarshaller().marshall(methodRes, objectType='appy')
marshaller = XmlMarshaller()
oType = isinstance(methodRes, Object) and 'popo' or 'appy'
res = marshaller.marshall(methodRes, objectType=oType)
except Exception, e:
tb = sutils.Traceback.get()
res = XmlMarshaller(rootTag='exception').marshall(tb)