MCPcopy
hub / github.com/django/django / prepare_value

Method prepare_value

django/forms/fields.py:1387–1390  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

1385 return InvalidJSONInput(data)
1386
1387 def prepare_value(self, value):
1388 if isinstance(value, InvalidJSONInput):
1389 return value
1390 return json.dumps(value, ensure_ascii=False, cls=self.encoder)
1391
1392 def has_changed(self, initial, data):
1393 if super().has_changed(initial, data):

Callers 2

test_prepare_valueMethod · 0.95

Calls 1

dumpsMethod · 0.45

Tested by 2

test_prepare_valueMethod · 0.76