gavo.formal.validation module¶
- class gavo.formal.validation.CallableValidator(callable)[source]¶
Bases:
objectA validator that delegates the validation of non-None values to a callable with the same signature as IValidator.validate.
- exception gavo.formal.validation.FieldError(message, fieldName=None)[source]¶
Bases:
FormsErrorBase class for field-related exceptions. The failure message and the failing field name are stored as attributes.
- exception gavo.formal.validation.FieldRequiredError(message, fieldName=None)[source]¶
Bases:
FieldValidationErrorException that signals that a field that is marked as required was not entered.
- exception gavo.formal.validation.FieldValidationError(message, fieldName=None)[source]¶
Bases:
FieldErrorException that signals that a field failed to validate.
- exception gavo.formal.validation.FormError(message)[source]¶
Bases:
FormsErrorForm validation error. Raise this, typically from a submit callback, to signal that the form (not an individual field) failed to validate.
- class gavo.formal.validation.LengthValidator(min=None, max=None)[source]¶
Bases:
objectValidate the length of the value is within a given range.
- class gavo.formal.validation.PatternValidator(regex)[source]¶
Bases:
objectValidate the value is a certain pattern.
The required pattern is defined as a regular expression. The regex will be compiled automatically if necessary.