I'm trying to figure out how to create an 'optional' field - specifically an optional email address.

What I've had to do is:

TableForm(widgets=[TextField(name='email', validator=validators.Any(validators.Empty(), validators.Email()))])

(ValidateAny seems to be referenced in a docstring, but it's actually formencode.compound.Any, which is in turbogears.validators.Any)

Someone pointed me at the not_empty=False kwarg, but the Email validator seems to ignore it - each to_python should inspect and deal with it.. - but this seems like a misdesign anyway - why should the subclass have to reimplement the 'not_empty' semantic?

Is there a bug tracker for formencode? I couldn't find it, and no one on irc knew about it.
--
Regards,
Stephen Thorne
Development Engineer

Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)

Reply via email to