1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #17413 -- Serialization of form errors along with all metadata.

This commit is contained in:
Loic Bistuer
2013-11-30 02:38:13 +07:00
committed by Tim Graham
parent e2f142030b
commit 3ce9829b61
8 changed files with 129 additions and 20 deletions

View File

@@ -353,6 +353,12 @@ Forms
* The new :meth:`~django.forms.Form.add_error()` method allows adding errors
to specific form fields.
* The dict-like attribute :attr:`~django.forms.Form.errors` now has two new
methods :meth:`~django.forms.Form.errors.as_data()` and
:meth:`~django.forms.Form.errors.as_json()`. The former returns a ``dict``
that maps fields to their original errors, complete with all metadata
(error code and params), the latter returns the errors serialized as json.
Internationalization
^^^^^^^^^^^^^^^^^^^^