textual.validation
This module provides a number of classes for validating input.
See Validating Input for details.
Failure
dataclass
¶
Function
¶
Bases: Validator
A flexible validator which allows you to provide custom validation logic.
function
instance-attribute
¶
Function which takes the value to validate and returns True if valid, and False otherwise.
ReturnedFalse
dataclass
¶
validate
¶
validate(value)
Validate that the supplied function returns True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The value to pass into the supplied function. |
required |
Returns:
| Type | Description |
|---|---|
ValidationResult
|
A ValidationResult indicating success if the function returned True, and failure if the function return False. |