failed when returning empty values

Asked by Mr T

unlike other RPC framework (like spyne), Ladon force us to always return values.

For instance, we needed to return ["None"] instead of empty [ ] arrays.

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
Mr T
Solved:
Last query:
Last reply:
Revision history for this message
Mr T (mrjaspe) said :
#1

To allow empty values to be returned, we can modify the ladontype.py (at /opt/amiga4gas/environments/env2.7/lib/python2.7/site-packages/ladon/types/ladontype.py), like this:

if (val is None): # Fix to avoid exception when returning empty values
        attr_list += [tc.to_unicode_string("",attr_type[0])]
else:
        attr_list += [tc.to_unicode_string(val,attr_type[0])]