def renderElement(self, item): item_lvl1 = {} for (k1, val1) in sudsobject.items(item): if val1 and type(val1) is list: l = list() for i, v2 in enumerate(val1): if isinstance(v2,sudsobject.Object): item_lvl2 = {} for (k2, val2) in sudsobject.items(v2): item_lvl2[k2]=encode(val2) l.append(item_lvl2) else: l.append(encode(v2)) item_lvl1[k1]=l else: item_lvl1[k1]=encode(val1) return item_lvl1
def items(cls, sobject): """ Extract the I{items} from a suds object much like the items() method works on I{dict}. @param sobject: A suds object @type sobject: L{Object} @return: A list of items contained in I{sobject}. @rtype: [(key, value),...] """ return sudsobject.items(sobject)