Hi all,
about Colander I have 2 questions:
[1]
given a colander schema like
class Principal(MappingSchema):
is_enabled = SchemaNode(Bool()
, title = 'Enabled?'
, foo = 'bar'
)
How can I build a list of the defined fields which are class attributes and tell their kwargs?
(I'd like to use Colander to define more general data dictionaries and want to read those definitions under different circumstances.)
[2]
If many schemas have several attributes in common, is it possible to define them in a separate schema and use that as a mix-in? Or must the common schema be inherited from?
[a] Mixin
class MyMixin(object):
frobotz = SchemaNode(Bool()
, title = 'FroBotz?'
, baz = 'qux'
)
class MySchema(MappingSchema, MyMixin):
...
[b] Inheritance
class MyMixin(MappingSchema):
frobotz = SchemaNode(Bool()
, title = 'FroBotz?'
, baz = 'qux'
)
class MySchema(MyMixin):
...
Thanks for your help.
Dirk