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

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/9FiyoAgOi2AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to