Is it possible to define a Colander schema with fieldnames that aren't
valid Python identifiers? I want to validate the settings in my INI
file at application startup, both to ensure that any exceptions are
raised immediately rather than later, and to convert values to their
proper types so I don't have to use asbool() etc everywhere. But INI
files have keys like "sqlalchemy.url" which can't be declared in
class-attribute syntax. FornEncode has a 'fields' attribute for this,
which lets you define fields as a dict.

I ran into this problem earlier and decided to use FornEncode, but now
I want to make my app Python 3 compatible and FormEncode is not yet
ported to it.

Also, does Colander have flags equivalent to FormEncode's
'allow_other_keys' and 'filter_other_keys'? Because the settings may
have keys not mentioned in the schema, which should be preserved.

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to