def validator(v): if v not in s: raise ValidationError("{} not in {}".format(v, s))
def validator(v): if not isinstance(v, t): raise ValidationError("{} not an instance of {}".format(v, t))
def validate_ipv4_address(value): if not isinstance(value, IPv4Address): raise ValidationError( value, u"Field %s requires type to be IPv4Address (not %s)" % (u"target_ip", type(value)))