Check if some tracked fields have changed
5727
def _has_changed(instance):
    
    for field, value in instance._original_fields.items():
        if field != 'pk' and \
           not isinstance(instance._meta.get_field(field), ManyToManyField):
            try:
                if field in getattr(instance, '_tracked_fields', []):
                    if isinstance(instance._meta.get_field(field), ForeignKey):
                        if getattr(instance, '{0}_id'.format(field)) != value:
                            return True
                    else:
                        if getattr(instance, field) != value:
                            return True
            except TypeError:
                # Can't compare old and new value, should be different.
                return True
    return False
1040406
public function processBeforeSave(array $fieldData, array $trackData)
    {
        $this->changed = false;

        if (! $this->exists) {
            return null;
        }

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $field->calculationStart($trackData);
            }
        }

        $output = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $inVal  = isset($fieldData[$key]) ? $fieldData[$key] : null;
                $outVal = $field->calculateFieldValue($inVal, $fieldData, $trackData);

                if (is_array($outVal) || is_array($inVal)) {
                   if (is_array($outVal) && is_array($inVal)) {
                        $changedNow = ($outVal != $inVal);
                    } else {
                        $changedNow = true;
                    }
                } else {
                    $changedNow = ((string) $inVal !== (string) $outVal);
                }
                $this->changed = $this->changed || $changedNow;

                $fieldData[$key] = $outVal; // Make sure the new value is available to the next field
                $output[$key]    = $outVal;
            }
        }

        return $output;
    }
1217083
def emitDataChanged(self, regItem):
        
        leftIndex = self.indexFromItem(regItem, col=0)
        rightIndex = self.indexFromItem(regItem, col=-1)

        logger.debug("Data changed: {} ...{}".format(self.data(leftIndex), self.data(rightIndex)))
        self.dataChanged.emit(leftIndex, rightIndex)
877923
def modified_on(self):
    """"""
    timestamp = self._info.get('lastModifiedTime')
    return _parser.Parser.parse_timestamp(timestamp)
97957
def changed(self):
        """"""
        return {key: value for key, value in six.iteritems(self)
                if getattr(self, key).changed}
439126
def _has_changed_related(instance):
    
    tracked_related_fields = getattr(
        instance,
        '_tracked_related_fields',
        {}
    ).keys()
    for field, value in instance._original_fields.items():
        if field != 'pk' and \
           not isinstance(instance._meta.get_field(field), ManyToManyField):
            if field in tracked_related_fields:
                if isinstance(instance._meta.get_field(field), ForeignKey):
                    if getattr(instance, '{0}_id'.format(field)) != value:
                        return True
                else:
                    if getattr(instance, field) != value:
                        return True
    return False
1205272
function changed($key=NULL) {
		if (isset($key))
			return $this->fields[$key]['changed'];
		foreach($this->fields as $key=>$field)
			if ($field['changed'])
				return TRUE;
		return FALSE;
	}
193307
def _track_class_field(cls, field):
    
    if '__' in field:
        _track_class_related_field(cls, field)
        return
    # Will raise FieldDoesNotExist if there is an error
    cls._meta.get_field(field)
    # Detect m2m fields changes
    if isinstance(cls._meta.get_field(field), ManyToManyField):
        m2m_changed.connect(
            tracking_m2m,
            sender=getattr(cls, field).through,
            dispatch_uid=repr(cls),
        )
231048
def hook_changed(self, hook, new_data):
        """"""
        for field in self.hooks[hook]:
            widget = self.widgets[field]
            field.hook_changed(hook, widget, new_data)
953672
def check_for_changes(name=nil)
      changed = []
      if name == nil
        self.cache_hash.keys.dup.each do |name|
          if reload_on_change(name)
            changed << name
          end
        end
      else
        name = name.to_s
        if reload_on_change(name)
          changed << name
        end
      end
      logger.debug "check_for_changes(#{name.inspect}) => #{changed.inspect}"
      changed
    end
83549
def _scan(self, trigger=True):
        
        changed = False
        files_seen = set()
        os_path_join = os.path.join
        for path in self.paths:
            for root, dirs, files in os.walk(path):
                for f in files:
                    fpath = os_path_join(root, f)
                    if not self.is_valid_type(fpath):
                        continue
                    files_seen.add(fpath)
                    if self._requires_new_modtime(fpath):
                        self._watch_file(fpath, trigger)
                        changed = True
            for f in self._watched_files:
                if f not in files_seen:
                    self._unwatch_file(f, trigger)
                    changed = True
        return changed
307835
def is_training_modified(self):
        

        last_modified = self.trainer.get_last_modified()
        if last_modified > self.training_timestamp:
            return True
        else:
            return False
952655
def _track_changes(self):
        
        if self._field and getattr(self._parent, '_track_changes',
                                   None) is not None:
            self._parent._track_changes.add(self._field)
152705
def text_changed(self):
        """"""
        self.default = False
        self.editor.document().changed_since_autosave = True
        self.text_changed_at.emit(self.filename,
                                  self.editor.get_position('cursor'))
917888
protected function _ensureTrackFields()
    {
        if (! is_array($this->_fields)) {
            // Check for cases where the track id is zero, but there is a field for track 0 in the db
            if ($this->_trackId) {
                $model  = $this->getMaintenanceModel();
                $fields = $model->load(array('gtf_id_track' => $this->_trackId), array('gtf_id_order' => SORT_ASC));
            } else {
                $fields = false;
            }

            $this->_fields      = array();
            $this->_trackFields = array();
            if (is_array($fields)) {
                $this->exists = true;

                foreach ($fields as $field) {
                    $key = self::makeKey($field['sub'], $field['gtf_id_field']);

                    $class = 'Field\\' . ucfirst($field['gtf_field_type']) . 'Field';
                    $this->_fields[$key] = $this->tracker->createTrackClass($class, $this->_trackId, $key, $field);

                    $this->_trackFields[$key] = $field;
                }
                // \MUtil_Echo::track($this->_trackFields);
            } else {
                $this->exists       = false;
            }
        }
    }
1364845
protected function hasGitTrackedFilesChanged()
    {
        $task = $this->getGitBuildStack()
            ->exec("status --untracked-files=no --porcelain");

        /** @var Result $result */
        $result = $this->runSilentCommand($task);

        $changes = array_filter(
            explode("\n", $result->getMessage())
        );

        return (bool) count($changes) != 0;
    }
374596
def changed(self, *fields):
        
        S = super(Value, self).changed
        for fld in fields or (None,): # no args tests for any change
            if S(fld):
                return True
        return False