From 5b6181f4d58f63e7d2b52ab94e162e5ce8980f12 Mon Sep 17 00:00:00 2001 From: Tim Heap Date: Fri, 10 Mar 2017 10:45:50 +1100 Subject: Fixed #27922 -- Added ErrorDict.get_json_data(). --- docs/ref/forms/api.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index fda7472105..72ae044090 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -165,6 +165,17 @@ If for some reason you don't want to use client-side escaping, you can also set ``escape_html=True`` and error messages will be escaped so you can use them directly in HTML. +.. method:: Form.errors.get_json_data(escape_html=False) + +.. versionadded:: 2.0 + +Returns the errors as a dictionary suitable for serializing to JSON. +:meth:`Form.errors.as_json()` returns serialized JSON, while this returns the +error data before it's serialized. + +The ``escape_html`` parameter behaves as described in +:meth:`Form.errors.as_json()`. + .. method:: Form.add_error(field, error) This method allows adding errors to specific fields from within the -- cgit v1.3