Args:
            from_db (bool): Check changes against actual db data
        Returns:
            list: List of fields names which their values changed.
9291
def changed_fields(self, from_db=False):
        
        if self.exist:
            current_dict = self.clean_value()
            # `from_db` attr is set False as default, when a `ListNode` is
            # initialized just after above `clean_value` is called. `from_db` flags
            # in 'list node sets' makes differences between clean_data and object._data.

            db_data = self._initial_data
            if from_db:
                # Thus, after clean_value, object's data is taken from db again.
                db_data = self.objects.data().get(self.key)[0]

            set_current, set_past = set(current_dict.keys()), set(db_data.keys())
            intersect = set_current.intersection(set_past)
            return set(o for o in intersect if db_data[o] != current_dict[o])
68044
def _load_data(self, data, from_db=False):
        
        self._data = data[:]
        self.setattrs(
            values=[],
            node_stack=[],
            node_dict={},
        )
        self._from_db = from_db
257949
def get_column_names(context, query):
        """"""
        table_info = context.sql_client.send(query)
        if 'fields' in table_info:
            return table_info['fields']

        return None
1004302
def isRecord(self, db=None):
        
        if db is not None:
            same_db = db == self.context().db

        if db is None or same_db:
            col = self.schema().idColumn()
            with ReadLocker(self.__dataLock):
                return (col in self.__loaded) and (self.__values[col.name()][0] is not None)
        else:
            return None
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
1230126
def has_changed(self, field_name: str = None) -> bool:
        
        changed = self._diff_with_initial.keys()

        if self._meta.get_field(field_name).get_internal_type() == 'ForeignKey':
            if not field_name.endswith('_id'):
                field_name = field_name+'_id'

        if field_name in changed:
            return True

        return False
1142917
def create_update_event(self):
        
        events = []

        for fields, rules in iteritems(self._meta.update_messages):
            if not isinstance(fields, (list, tuple, set)):
                fields = (fields,)

            changed = any([
                getattr(self, field) != getattr(self.get_original(), field)
                for field in fields
            ])

            if changed:
                event = self.create_audit_event(code=rules['code'])
                event.body = rules['message']
                event.meta = self.parse_meta(rules['meta'])
                events.append(event)

        self.update_event_callback(events)

        with db.database.atomic():
            for event in events:
                event.save()

        return events
994847
def _get_changes(self):
        ''''''
        result = dict( (f['id'], f.get('value','')) for f in self._data if f.get('changed', False) )
        self._clear_changes
        return result
819405
def show_dbs():
    

    l = []
    mc = client_connector()
    if not mc:
        # The client couldn't connect
        return ()

    dbs = mc.database_names()
    for d in dbs:
        dbc = mc[d]
        collections = dbc.collection_names()
        collections = remove_values_from_list(collections, "system.indexes")
        l.append({"name": d, "collections": collections})
    return tuple(l)
955198
def change_and_save(self, update_only_changed_fields=False, **changed_fields):
        
        bulk_change_and_save(self, update_only_changed_fields=update_only_changed_fields, **changed_fields)
        return self.filter()
1137711
def get_fields(self, db_name, table_name):
    
    self.send_get_fields(db_name, table_name)
    return self.recv_get_fields()
765715
def bulk_change_and_save(iterable, update_only_changed_fields=False, save_kwargs=None, **changed_fields):
    
    return [
        change_and_save(obj, update_only_changed_fields=update_only_changed_fields, save_kwargs=save_kwargs,
                        **changed_fields)
        for obj in iterable
    ]
833811
public function changedFieldNames()
    {
        $diffed = clone $this->fromRecord;
        $fields = array_keys($diffed->toMap());

        $changedFields = [];

        foreach ($fields as $field) {
            if (in_array($field, $this->ignoredFields)) {
                continue;
            }
            if ($this->fromRecord->$field != $this->toRecord->$field) {
                $changedFields[] = $field;
            }
        }

        return $changedFields;
    }
869558
def _check_diff(changes):
    '''
    
    '''
    for conf_dict in changes:
        if conf_dict == 'Networks':
            continue
        for item in changes[conf_dict]:
            if changes[conf_dict][item]['new'] is None:
                old = changes[conf_dict][item]['old']
                if old == '':
                    return True
                else:
                    try:
                        if all(x == '' for x in old):
                            return True
                    except TypeError:
                        # Old value is not an iterable type
                        pass
    return False
662878
def _get_changes_from_diff_dict(diff_dict):
    '''
    
    '''
    changes_strings = []
    for p in diff_dict.keys():
        if not isinstance(diff_dict[p], dict):
            raise ValueError('Unexpected diff difct \'{0}\''.format(diff_dict))
        if sorted(diff_dict[p].keys()) == ['val1', 'val2']:
            # Some string formatting
            from_str = diff_dict[p]['val1']
            if isinstance(diff_dict[p]['val1'], six.string_types):
                from_str = '\'{0}\''.format(diff_dict[p]['val1'])
            elif isinstance(diff_dict[p]['val1'], list):
                from_str = '\'{0}\''.format(', '.join(diff_dict[p]['val1']))
            to_str = diff_dict[p]['val2']
            if isinstance(diff_dict[p]['val2'], six.string_types):
                to_str = '\'{0}\''.format(diff_dict[p]['val2'])
            elif isinstance(diff_dict[p]['val2'], list):
                to_str = '\'{0}\''.format(', '.join(diff_dict[p]['val2']))
            changes_strings.append('{0} from {1} to {2}'.format(
                p, from_str, to_str))
        else:
            sub_changes = _get_changes_from_diff_dict(diff_dict[p])
            if sub_changes:
                changes_strings.append('{0}:'.format(p))
                changes_strings.extend(['\t{0}'.format(c)
                                       for c in sub_changes])
    return changes_strings
649660
def export_modifications(self):
        

        result = {}

        for key, value in self.__modified_data__.items():
            try:
                result[key] = value.export_data()
            except AttributeError:
                result[key] = value

        for key, value in self.__original_data__.items():
            if key in result.keys() or key in self.__deleted_fields__:
                continue
            try:
                if not value.is_modified():
                    continue
                modifications = value.export_modifications()
            except AttributeError:
                continue

            try:
                result.update({'{}.{}'.format(key, f): v for f, v in modifications.items()})
            except AttributeError:
                result[key] = modifications

        return result
570960
def has_changed(self, field):
        """"""
        if field in self.fields:
            # deferred fields haven't changed
            if field in self.deferred_fields and field not in self.instance.__dict__:
                return False
            return self.previous(field) != self.get_field_value(field)
        else:
            raise FieldError('field "%s" not tracked' % field)