Created
August 1, 2018 03:30
-
-
Save tristan2077/88ed57450e8cfc67312ac31afc2bbdf5 to your computer and use it in GitHub Desktop.
flask_gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(self): | |
""" | |
Validates the form by calling `validate` on each field, passing any | |
extra `Form.validate_<fieldname>` validators to the field validator. | |
""" | |
extra = {} | |
for name in self._fields: | |
inline = getattr(self.__class__, 'validate_%s' % name, None) | |
if inline is not None: | |
extra[name] = [inline] | |
return super(Form, self).validate(extra) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment