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

Method has_changed

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

Source from the content-addressed store, hash-verified

1166 raise NotImplementedError("Subclasses must implement this method.")
1167
1168 def has_changed(self, initial, data):
1169 if self.disabled:
1170 return False
1171 if initial is None:
1172 initial = ["" for x in range(0, len(data))]
1173 else:
1174 if not isinstance(initial, list):
1175 initial = self.widget.decompress(initial)
1176 for field, initial, data in zip(self.fields, initial, data):
1177 try:
1178 initial = field.to_python(initial)
1179 except ValidationError:
1180 return True
1181 if field.has_changed(initial, data):
1182 return True
1183 return False
1184
1185
1186class FilePathField(ChoiceField):

Callers 1

Calls 3

decompressMethod · 0.45
to_pythonMethod · 0.45
has_changedMethod · 0.45

Tested by 1