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

Fixed #24988 -- Documented passing a dictionary of ValidationErrors to ValidationError #5088

Closed
wants to merge 1 commit into from

Conversation

daisylb
Copy link
Contributor

@daisylb daisylb commented Aug 3, 2015

@@ -205,6 +205,15 @@ with ``code``\s and ``params`` but a list of strings will also work::
_('Error 2'),
])

If you detect multiple errors in multiple fields in your form, for instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only work in Form.clean(), so "for instance" is a little light here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll also work in Model.clean() obviously but these are the forms docs, which is a bit of a problem, Model.clean() is actually the only place where this pattern is recommended, Form.clean() should use Form.add_error() instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new snippet should be moved to the model validation docs, then, correct?

@timgraham timgraham changed the title #24988: Add docs passing a dictionary of ValidationErrors to ValidationError Fixed #24988 -- Documented passing a dictionary of ValidationErrors to ValidationError Aug 3, 2015
@timgraham
Copy link
Member

Updated and merged in 52a190b, thanks!

@timgraham timgraham closed this Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants