def _unserialize_value(self, value): if not isinstance(value, basestring): raise InvalidTypeError(value=value).construct(self, 'invalid') try: return import_object(value) except ImportError: raise ValidationError(value=value).construct(self, 'import')
def _unserialize_value(self, value, ancestry): if isinstance(value, basestring): try: return import_object(value) except ImportError: error = ValidationError(identity=ancestry, field=self, value=value).construct("import", value=value) raise error.capture() else: return value
def _unserialize_value(self, value, ancestry): if isinstance(value, basestring): try: return import_object(value) except ImportError: error = ValidationError(identity=ancestry, field=self, value=value).construct( 'import', value=value) raise error.capture() else: return value
def _get_implementation(cls, token): if token is None: return surrogate elif token in cls.cache: return cls.cache[token] try: impl = import_object(token) except ImportError: impl = surrogate cls.cache[token] = impl return impl