@classmethod
def update_or_create(cls, attributes, values=None):
    """
        Create or update a record matching the attributes, and fill it with values.

        :param attributes: The instance attributes
        :type attributes: dict

        :param values: The values
        :type values: dict

        :return: The new instance
        :rtype: Model
        """
    instance = cls.first_or_new(**attributes)
    if values is None:
        values = {}
    instance.fill(**values).save()
    return instance
