Add a function to retrieve an attribute definition of a complex type

This commit is contained in:
Christophe de Vienne
2011-10-24 18:05:42 +02:00
parent fd3475a9f3
commit b70bb7a04e

View File

@@ -172,3 +172,9 @@ def list_attributes(class_):
if not hasattr(class_, '_wsme_attributes'):
register_type(class_)
return class_._wsme_attributes
def getattrdef(class_, name):
for attrname, attrdef in class_._wsme_attributes:
if attrname == name:
return attrdef