Opened 17 years ago

Closed 17 years ago

#3869 closed (worksforme)

newforms form.errors.__all__ cannot render

Reported by: David S. <davidschein@…> 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 David S. <davidschein@…>, 17 years ago

Sorry, each underlined all should read more like _ _all_ _.

comment:2 by Adrian Holovaty, 17 years ago

Resolution: worksforme
Status: newclosed

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.
Back to Top