[EMAIL PROTECTED] wrote: > Is there a way to specify that None(empty, not present) is valid ? > Something equivalent to : > > if my_string is None or my_string=="": v = None > else: v = validator.to_python(my_string)
v = validator(if_empty=None).to_python(my_string) Note that you can clone any validator with modified arguments, by calling it with those arguments. I.e., these are the same: v = validators.Int(max=10)(if_empty=0) v = validators.Int(max=10, if_empty=0)