Search code examples
pythonformencode

Formencode and empty values


How can I write a custom validator which is always executed, even when the user has submitted an empty or missing value?

I've tried overriding the to_python, validate_python, _to_python, _validate_python (and more) methods but none of these seem to get run if the user has submitted an empty or None value


Solution

  • I ended up moving from FormEncode to WTForms and everything is now a whole lot easier. Seems to me like Formencode wasn't very well thought out.