Esempio n. 1
0
 def validator(v):
     if v not in s:
         raise ValidationError("{} not in {}".format(v, s))
Esempio n. 2
0
 def validator(v):
     if not isinstance(v, t):
         raise ValidationError("{} not an instance of {}".format(v, t))
Esempio n. 3
0
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)))