def validate_type(self):
        if isinstance(self._value, self.base_type):
            return True

        elif type(self._value) == str:
            self._value = unicode(self._value)
            logging.warning('Coerced input value to unicode from string')
            return True

        else:
            if self.allow_empty:
                if self._value == None:
                    return True

                try:
                    logging.warning('Type does not match, coercing to unicode string anyway.')
                    self._value = unicode(self._value)
                except:
                    raise TypeError((self.__class__.__name__, str(self.base_type), str(type(self._value))) % "Value for %s must be %s (input was %s)")
dataset/ETHPy150Open lonelycode/Mojo/Mojo/ObjectMapper/Fields.py/StringField.validate_type/swapped operands of `%`