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

Document filters #793

Closed
azmeuk opened this issue Jul 21, 2023 · 0 comments · Fixed by #796
Closed

Document filters #793

azmeuk opened this issue Jul 21, 2023 · 0 comments · Fixed by #796
Labels
documentation Related to the documentation

Comments

@azmeuk
Copy link
Member

azmeuk commented Jul 21, 2023

We should better document filters. For the moment this does not really explain what they do and how to use them:

:param filters:
A sequence of filters which are run on input data by `process`.

Though, inline filters have slightly better documentation:

wtforms/docs/forms.rst

Lines 149 to 158 in 0524993

The same principle applies for filters with the convention `filter_fieldname`::
class SignupForm(Form):
name = StringField('name')
def filter_name(form, field):
return field.strip()
Note that filters are applied after processing the default and incoming data,
but before validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to the documentation
Development

Successfully merging a pull request may close this issue.

1 participant