suou.validators

Miscellaneous validator closures.

Functions

matches(regex, /[, length, flags])

Return a function which returns True if X is shorter than length and matches the given regex.

must_be(obj, typ, message, *[, exc])

Raise TypeError if the requested object is not of the desired type(s), with a nice message.

not_greater_than(y)

Return a function that returns True if X is not greater than (i.e. lesser than or equal to) the given value.

not_less_than(y)

Return a function that returns True if X is not less than (i.e. greater than or equal to) the given value.

yesno(x)

Returns False if x.lower() is in '0', '', 'no', 'n', 'false' or 'off'.