Validators

Modified

2024-10-10

textValidator()

A validator for text values.

Signature

textValidator(
    minLength: int = None,
    maxLength: int = None,
    allowDigits: bool = True,
    error: str = None
) -> ValidatorModel

Arguments

maxLength : int
Maximum length for the text validator.

allowDigits : bool
Whether to allow digits for the text validator. Default is True.

error : str
Custom error text to display. Optional.

emailValidator()

A validator for email values.

Signature

emailValidator(
    error: str = None
) -> ValidatorModel

Arguments

regexValidator()

A regex based validator.

Signature

regexValidator(
    regex: str = None,
    error: str = None
) -> ValidatorModel

Arguments

error : str
Custom error text to display. Optional

expressionValidator()

An expression based validator.

Signature

expressionValidator(
    expression: str = None,
    error: str = None
) -> ValidatorModel

Arguments

error : str
Custom error text to display. Optional

numberValidator()

A validator for number values.

Signature

numberValidator(
    minValue: int = None,
    maxValue: int = None,
    error: str = None
) -> ValidatorModel

Arguments

maxValue : int
Maximum value for the number validator.

error : str
Custom error text to display. Optional.

answerCountValidator()

A validator for answer count.

Signature

answerCountValidator(
    minCount: int = None,
    maxCount: int = None,
    error: str = None
) -> ValidatorModel

Arguments

maxCount : int
Maximum count for the answer count validator.

error : str
Custom error text to display. Optional