MCPcopy
hub / github.com/django/django / get_json_data

Method get_json_data

django/forms/utils.py:169–179  ·  view source on GitHub ↗
(self, escape_html=False)

Source from the content-addressed store, hash-verified

167 return copy
168
169 def get_json_data(self, escape_html=False):
170 errors = []
171 for error in self.as_data():
172 message = next(iter(error))
173 errors.append(
174 {
175 "message": escape(message) if escape_html else message,
176 "code": error.code or "",
177 }
178 )
179 return errors
180
181 def get_context(self):
182 return {

Callers 1

test_error_listMethod · 0.95

Calls 3

as_dataMethod · 0.95
escapeFunction · 0.90
appendMethod · 0.45

Tested by 1

test_error_listMethod · 0.76