Validate
        Perform value validation against validation settings and return
        simple result object

        :param value:           str, value to check
        :param model:           parent model being validated
        :param context:         object or None, validation context
        :return:                shiftschema.results.SimpleResult

def validate(self, value, model=None, context=None):
        """
        Validate
        Perform value validation against validation settings and return
        simple result object

        :param value:           str, value to check
        :param model:           parent model being validated
        :param context:         object or None, validation context
        :return:                shiftschema.results.SimpleResult
        """

        length = len(str(value))
        params = dict(min=self.min, max=self.max)

        # too short?
        if self.min and self.max is None:
            if length < self.min:
                return Error(self.too_short, params)

        # too long?
        if self.max and self.min is None:
            if length > self.max:
                return Error(self.too_long, params)

        # within range?
        if self.min and self.max:
            if length < self.min or length > self.max:
                return Error(self.not_in_range, params)

        # success otherwise
        return Error()