The complex types attribute are now reset to 'Unset' when inspected

This commit is contained in:
Christophe de Vienne 2011-10-21 18:42:55 +02:00
parent 9ad63122c9
commit 974885de97

View File

@ -14,6 +14,12 @@ complex_types = []
array_types = []
class UnsetType(object):
pass
Unset = UnsetType()
def iscomplex(datatype):
return hasattr(datatype, '_wsme_attributes')
@ -119,6 +125,8 @@ def inspect_class(class_):
attrdef = wsattr(attr)
attributes.append((name, attrdef))
setattr(class_, name, Unset)
sort_attributes(class_, attributes)
return attributes