diff options
| author | Ties Jan Hefting <hello@tiesjan.com> | 2021-07-07 22:50:30 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-07-15 07:00:39 +0200 |
| commit | 84400d2e9db7c51fee4e9bb04c028f665b8e7624 (patch) | |
| tree | 467414be65e1641a02dbcafa575acfff3b09c2b2 /docs | |
| parent | 7f33c1e22dbc34a7afae7967783725b10f1f13b1 (diff) | |
Fixed #32905 -- Added CSS class for non-form errors of formsets.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/4.0.txt | 4 | ||||
| -rw-r--r-- | docs/topics/forms/formsets.txt | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index f0742db7bd..ee3922c9b6 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -218,6 +218,10 @@ Forms error message. This allows custom error messages to use the ``%(value)s`` placeholder. +* :class:`~django.forms.formsets.BaseFormSet` now renders non-form errors with + an additional class of ``nonform`` to help distinguish them from + form-specific errors. + Generic Views ~~~~~~~~~~~~~ diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 1f2c7c3fad..0281b6a4d6 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -365,6 +365,20 @@ The formset ``clean`` method is called after all the ``Form.clean`` methods have been called. The errors will be found using the ``non_form_errors()`` method on the formset. +Non-form errors will be rendered with an additional class of ``nonform`` to +help distinguish them from form-specific errors. For example, +``{{ formset.non_form_errors }}`` would look like: + +.. code-block:: html+django + + <ul class="errorlist nonform"> + <li>Articles in a set must have distinct titles.</li> + </ul> + +.. versionchanged:: 4.0 + + The additional ``nonform`` class was added. + Validating the number of forms in a formset =========================================== |
