gavo.formal.validation module¶
-
class
gavo.formal.validation.
CallableValidator
(callable)[source]¶ Bases:
object
A 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:
gavo.formal.validation.FormsError
Base 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:
gavo.formal.validation.FieldValidationError
Exception that signals that a field that is marked as required was not entered.
-
exception
gavo.formal.validation.
FieldValidationError
(message, fieldName=None)[source]¶ Bases:
gavo.formal.validation.FieldError
Exception that signals that a field failed to validate.
-
exception
gavo.formal.validation.
FormError
(message)[source]¶ Bases:
gavo.formal.validation.FormsError
Form 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:
object
Validate the length of the value is within a given range.
-
class
gavo.formal.validation.
PatternValidator
(regex)[source]¶ Bases:
object
Validate the value is a certain pattern.
The required pattern is defined as a regular expression. The regex will be compiled automatically if necessary.