diff options
Diffstat (limited to 'django/forms/utils.py')
-rw-r--r-- | django/forms/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py index e3151c9390..587cea85a3 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -51,8 +51,11 @@ class ErrorDict(dict): def as_data(self): return {f: e.as_data() for f, e in self.items()} + def get_json_data(self, escape_html=False): + return {f: e.get_json_data(escape_html) for f, e in self.items()} + def as_json(self, escape_html=False): - return json.dumps({f: e.get_json_data(escape_html) for f, e in self.items()}) + return json.dumps(self.get_json_data(escape_html)) def as_ul(self): if not self: |