Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for FormValidator maybe be inaccurate re: .validate method #112

Open
mhavard999 opened this issue Jun 2, 2016 · 0 comments

Comments

@mhavard999
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant