[spyne] Serializing a model

Burak Arslan burak.arslan at arskom.com.tr
Fri Jun 20 10:20:21 UTC 2014

On 06/19/14 19:53, Joseph L. Casale wrote:
>> huh. this is supposed to work, the sole purpose of XmlData is to have
>> whatever's inside as simpleContent.
>> See: https://gist.github.com/plq/11e4c28d5eeba7d145a7
>> class Node(ComplexModel):
>>     ATTR = XmlAttribute(Unicode)
>>     data = XmlData(Unicode(max_len=450, values=['1st', '2nd']))
> Hey Burak,
> Solved it, the values param needed to be passed to the XmlAttribute Unicode
> instance, then as the real attribute name is a python reserved word, the whole
> lot was stuffed in a _type_info.
> Now the get_object_as_dict method serializes the Node model as a list of dicts
> indicating the correlated attribute value which is exactly what I needed.

Hi Joseph,

Digging deeper, I found a bug regarding serialization of None to
mandatory xmlattribute fields, which is now fixed. Please test with
latest code from arskom/spyne and revert if you're still having issues.


More information about the people mailing list