'Mark a key as explicitly changed by the user.'

def _mark_as_changed(self, key):

    if (not key):
        return
    if (not hasattr(self, '_changed_fields')):
        return
    if ('.' in key):
        (key, rest) = key.split('.', 1)
        key = self._db_field_map.get(key, key)
        key = ('%s.%s' % (key, rest))
    else:
        key = self._db_field_map.get(key, key)
    if (key not in self._changed_fields):
        (levels, idx) = (key.split('.'), 1)
        while (idx <= len(levels)):
            if ('.'.join(levels[:idx]) in self._changed_fields):
                break
            idx += 1
        else:
            self._changed_fields.append(key)
            level = ('.'.join(levels[:idx]) + '.')
            remove = self._changed_fields.remove
            for field in self._changed_fields[:]:
                if field.startswith(level):
                    remove(field)
