OpenQuizz
Une application de gestion des contenus pédagogiques
Predicate Class Reference
Inheritance diagram for Predicate:
Collaboration diagram for Predicate:

Public Member Functions

def __init__ (self, str method, *typing.Optional[str] error=None, **kwargs)
 
typing.Any __call__ (self, typing.Any value)
 
- Public Member Functions inherited from Validator
str __repr__ (self)
 

Data Fields

 method
 
 error
 
 kwargs
 

Static Public Attributes

 default_message
 
- Static Public Attributes inherited from Validator
 error
 

Detailed Description

Call the specified ``method`` of the ``value`` object. The
validator succeeds if the invoked method returns an object that
evaluates to True in a Boolean context. Any additional keyword
argument will be passed to the method.

:param method: The name of the method to invoke.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}` and `{method}`.
:param kwargs: Additional keyword arguments to pass to the method.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
str  method,
*typing.Optional[str]   error = None,
**  kwargs 
)

Member Function Documentation

◆ __call__()

typing.Any __call__ (   self,
typing.Any  value 
)

Reimplemented from Validator.

Field Documentation

◆ default_message

default_message
static

◆ error

error

◆ kwargs

kwargs

◆ method

method

The documentation for this class was generated from the following file: