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

Public Member Functions

def __init__ (self, min=None, max=None, *bool min_inclusive=True, bool max_inclusive=True, typing.Optional[str] error=None)
 
_T __call__ (self, _T value)
 
- Public Member Functions inherited from Validator
str __repr__ (self)
 
typing.Any __call__ (self, typing.Any value)
 

Data Fields

 min
 
 max
 
 error
 
 min_inclusive
 
 max_inclusive
 

Static Public Attributes

 message_min
 
 message_max
 
 message_all
 
 message_gte
 
 message_gt
 
 message_lte
 
 message_lt
 
- Static Public Attributes inherited from Validator
 error
 

Detailed Description

Validator which succeeds if the value passed to it is within the specified
range. If ``min`` is not specified, or is specified as `None`,
no lower bound exists. If ``max`` is not specified, or is specified as `None`,
no upper bound exists. The inclusivity of the bounds (if they exist) is configurable.
If ``min_inclusive`` is not specified, or is specified as `True`, then
the ``min`` bound is included in the range. If ``max_inclusive`` is not specified,
or is specified as `True`, then the ``max`` bound is included in the range.

:param min: The minimum value (lower bound). If not provided, minimum
    value will not be checked.
:param max: The maximum value (upper bound). If not provided, maximum
    value will not be checked.
:param min_inclusive: Whether the `min` bound is included in the range.
:param max_inclusive: Whether the `max` bound is included in the range.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}`, `{min}` and `{max}`.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  min = None,
  max = None,
*bool   min_inclusive = True,
bool   max_inclusive = True,
typing.Optional[str]   error = None 
)

Member Function Documentation

◆ __call__()

_T __call__ (   self,
_T  value 
)

Field Documentation

◆ error

error

◆ max

max

◆ max_inclusive

max_inclusive

◆ message_all

message_all
static

◆ message_gt

message_gt
static

◆ message_gte

message_gte
static

◆ message_lt

message_lt
static

◆ message_lte

message_lte
static

◆ message_max

message_max
static

◆ message_min

message_min
static

◆ min

min

◆ min_inclusive

min_inclusive

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