Module: validators

Higher-level constraints on mappings of translated user input.

Fields provide what might be considered rudimentary validation during translation, but they are limited in scope to single values. Because validators work on entire dictionaries of values, they can implement much more elaborate rules enforcing patterns on user input.

To avoid indeterminate cases, most validators enforce their constraints only if all the keys they expect are present in the subject dict being validated.

Classes

Ascending

Validator to assert that a series of values are given in ascending order.

AtLeast

Validator to assert that at least a certain number of values are not None.

AtMost

Validator to assert that no more than a certain number of values are not None.

Descending

Validator to assert that a series of values are given in descending order.

Different

Validator to assert that a set of values are all different from one another.

EqualTo

Validator to assert that a set of fields are equal to a specific value according to ==.

IfAnyThen

Validator to assert that if any field from one set has been specified, then each field from another set must have a value.

OnlyIf

Validator for when a set of fields may have values only if every field in another set does.

Same

Validator to assert that a set of values are all equal to each other.

Unique

Validator to assert that a set of values are unique to a corresponding set of SQLAlchemy model properties.

ValidationError

Exception raised when a higher-level validation constraint fails.