def dirty_fields(self):
        """ Return an array of field names that are dirty

        Dirty means if a model was hydrated first from the
        store & then had field values changed they are now
        considered dirty.

        For new models all fields are considered dirty.

        :return: list
        """

        dirty_fields = []

        for field in self.all_fields:
            if field not in self._original:
                dirty_fields.append(field)
            elif self._original[field] != getattr(self, field):
                dirty_fields.append(field)
        return dirty_fields
def dirty_fields ( self ) : dirty_fields = [ ] for field in self . all_fields : if field not in self . _original : dirty_fields . append ( field ) elif self . _original [ field ] != getattr ( self , field ) : dirty_fields . append ( field ) return dirty_fields
Return an array of field names that are dirty

        Dirty means if a model was hydrated first from the
        store & then had field values changed they are now
        considered dirty.

        For new models all fields are considered dirty.

        :return: list