Mention wsme.types.Base

This commit is contained in:
Christophe de Vienne 2012-08-18 00:48:55 +02:00
parent 0439f96bf5
commit 53669cb935
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,8 @@
Changes Changes
======= =======
0.4 (next) 0.4b1 (next)
---------- ------------
* Now supports Python 3.2 * Now supports Python 3.2

View File

@ -129,6 +129,9 @@ Complex types
Complex types are structured types. They are defined as simple python classes Complex types are structured types. They are defined as simple python classes
and will be mapped to adequate structured types in the various protocols. and will be mapped to adequate structured types in the various protocols.
A base class for structured types is proposed, :class:`wsme.types.Base`,
but is not mandatory. The only thing it add is a default constructor.
The attributes that are set at the class level will be used by WSME to discover The attributes that are set at the class level will be used by WSME to discover
the structure. These attributes can be: the structure. These attributes can be:
@ -148,12 +151,12 @@ Example
:: ::
Gender = Enum(str, 'male', 'female') Gender = wsme.types.Enum(str, 'male', 'female')
Title = Enum(str, 'M', 'Mrs') Title = Ewsme.types.num(str, 'M', 'Mrs')
class Person(object): class Person(wsme.types.Base):
lastname = wsattr(unicode, mandatory=True) lastname = wsme.types.wsattr(unicode, mandatory=True)
firstname = wsattr(unicode, mandatory=True) firstname = wsme.types.wsattr(unicode, mandatory=True)
age = int age = int
gender = Gender gender = Gender