You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docstring in the source and the documentation online for FormValidator both repeatedly mention a .validate method:
The important method is .validate(), of course. It gets passed a
dictionary of the (processed) values from the form. If you have
.validate_partial_form set to True, then it will get the incomplete
values as well -- check with the "in" operator if the form was able
to process any particular field.
Anyway, .validate() should return a string or a dictionary. If a
string, it's an error message that applies to the whole form. If
not, then it should be a dictionary of fieldName: errorMessage.
The special key "form" is the error message for the form as a whole
(i.e., a string is equivalent to {"form": string}).
I'm not sure if .validate is meant to collectively stand in for all the different validate methods (i.e. _convert_to_python, _validate_python, _validate_other, etc), and I'm sorry if that is mentioned somewhere in the documentation, but I did get tripped up by it for a little bit when I was trying to sub class FormValidator to make a custom chained_validator.
The text was updated successfully, but these errors were encountered:
The docstring in the source and the documentation online for FormValidator both repeatedly mention a
.validate
method:I'm not sure if
.validate
is meant to collectively stand in for all the different validate methods (i.e._convert_to_python
,_validate_python
,_validate_other
, etc), and I'm sorry if that is mentioned somewhere in the documentation, but I did get tripped up by it for a little bit when I was trying to sub class FormValidator to make a custom chained_validator.The text was updated successfully, but these errors were encountered: