5.4. Handlers¶
5.4.1. Reserved name handlers¶
- class pathvalidate.handler.ReservedNameHandler[source]¶
- classmethod add_leading_underscore(e: ValidationError) str [source]¶
Reserved name handler that adds a leading underscore (
"_"
) to the name except for"."
and".."
.- Parameters:
e (ValidationError) – A reserved name error.
- Returns:
The converted name.
- Return type:
str
- classmethod add_trailing_underscore(e: ValidationError) str [source]¶
Reserved name handler that adds a trailing underscore (
"_"
) to the name except for"."
and".."
.- Parameters:
e (ValidationError) – A reserved name error.
- Returns:
The converted name.
- Return type:
str
- classmethod as_is(e: ValidationError) str [source]¶
Reserved name handler that returns the name as is.
- Parameters:
e (ValidationError) – A reserved name error.
- Returns:
The name as is.
- Return type:
str
5.4.2. Null value handlers¶
- class pathvalidate.handler.NullValueHandler[source]¶
- classmethod return_null_string(e: ValidationError) str [source]¶
Null value handler that always returns an empty string.
- Parameters:
e (ValidationError) – A validation error.
- Returns:
An empty string.
- Return type:
str
- classmethod return_timestamp(e: ValidationError) str [source]¶
Null value handler that returns a timestamp of when the function was called.
- Parameters:
e (ValidationError) – A validation error.
- Returns:
A timestamp.
- Return type:
str
5.4.3. Other handlers¶
- pathvalidate.handler.raise_error(e: ValidationError) str [source]¶
Null value handler that always raises an exception.
- Parameters:
e (ValidationError) – A validation error.
- Raises:
ValidationError – Always raised.