parameters: (self, initial, data)
docstring: Detects if the data was changed. This is added in 1.6.
docstring_summary: Detects if the data was changed. This is added in 1.6.
docstring_tokens: Detects if the data was changed . This is added in 1 . 6 .
function: def has_changed(self, initial, data):
          "Detects if the data was changed. This is added in 1.6."
          # Always return False if the field is disabled since self.bound_data
          # always uses the initial value in this case.
          if self.disabled:
              return False
          if initial is None and data is None:
              return False
          if data and not hasattr(data, '__iter__'):
              data = self.widget.decompress(data)
          initial = self.to_python(initial)
          data = self.to_python(data)
          if hasattr(self, '_coerce'):
              data = self._coerce(data)
          if isinstance(data, Model) and isinstance(initial, Model):
              return model_vars(data) != model_vars(initial)
          else:
              return data != initial
function_tokens: def has_changed ( self , initial , data ) : # Always return False if the field is disabled since self.bound_data # always uses the initial value in this case. if self . disabled : return False if initial is None and data is None : return False if data and not hasattr ( data , '__iter__' ) : data = self . widget . decompress ( data ) initial = self . to_python ( initial ) data = self . to_python ( data ) if hasattr ( self , '_coerce' ) : data = self . _coerce ( data ) if isinstance ( data , Model ) and isinstance ( initial , Model ) : return model_vars ( data ) != model_vars ( initial ) else : return data != initial