Opened 18 years ago
Closed 18 years ago
#3869 closed (worksforme)
newforms form.errors.__all__ cannot render
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If you implement a clean method on your newform and raise a validation error it is keyed on 'all'.
But, {{ form.errors.all }} raises a template error: "Variables and attributes may not begin with underscores: 'form.errors.all'"
Workaround is to put pass the form level errors the template context somewhere, e.g. form_errors=search_form.errors.get('all', None).
Change History (2)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Use form.non_field_errors
to access the errors that aren't associated with a particular field.
Note:
See TracTickets
for help on using tickets.
Sorry, each underlined all should read more like _ _all_ _.