[spyne] Complex data types and inheritance

Alex ralienpp at gmail.com
Sun Jun 8 20:07:53 UTC 2014


Hi,

Having looked through the documentation again, I think I found the
snippet that made me think inheritance works that way.

On this page: http://spyne.io/docs/2.10/manual/03_types.html#manual-types


```
class User(ComplexModel):
    user_name = Unicode(64, pattern='[a-z0-9_-]')
    email_address = Unicode(128, pattern='[^@]+@[^@]+')

class MandatoryUser(User):
    class Attributes(User.Attributes):
        nullable=False
        min_occurs=1
```

MandatoryUser inherits User; does this notation only work for adding
other constraints to the data type? Or should it also work with the
addition of new attributes?


Your comments will be greatly appreciated,
Alex


More information about the people mailing list