MCPcopy
hub / github.com/django/django / has_changed

Method has_changed

django/forms/fields.py:1392–1399  ·  view source on GitHub ↗
(self, initial, data)

Source from the content-addressed store, hash-verified

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):
1394 return True
1395 # For purposes of seeing whether something has changed, True isn't the
1396 # same as 1 and the order of keys doesn't matter.
1397 return json.dumps(initial, sort_keys=True, cls=self.encoder) != json.dumps(
1398 self.to_python(data), sort_keys=True, cls=self.encoder
1399 )

Callers 1

test_has_changedMethod · 0.95

Calls 3

to_pythonMethod · 0.95
has_changedMethod · 0.45
dumpsMethod · 0.45

Tested by 1

test_has_changedMethod · 0.76