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

Public Member Functions

def __init__ (self, typing.Optional[int] min=None, typing.Optional[int] max=None, *typing.Optional[int] equal=None, typing.Optional[str] error=None)
 
typing.Sized __call__ (self, typing.Sized value)
 
- Public Member Functions inherited from Validator
str __repr__ (self)
 
typing.Any __call__ (self, typing.Any value)
 

Data Fields

 min
 
 max
 
 error
 
 equal
 

Static Public Attributes

 message_min
 
 message_max
 
 message_all
 
 message_equal
 
- Static Public Attributes inherited from Validator
 error
 

Detailed Description

Validator which succeeds if the value passed to it has a
length between a minimum and maximum. Uses len(), so it
can work for strings, lists, or anything with length.

:param min: The minimum length. If not provided, minimum length
    will not be checked.
:param max: The maximum length. If not provided, maximum length
    will not be checked.
:param equal: The exact length. If provided, maximum and minimum
    length will not be checked.
: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,
typing.Optional[int]   min = None,
typing.Optional[int]   max = None,
*typing.Optional[int]   equal = None,
typing.Optional[str]   error = None 
)

Member Function Documentation

◆ __call__()

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

Field Documentation

◆ equal

equal

◆ error

error

◆ max

max

◆ message_all

message_all
static

◆ message_equal

message_equal
static

◆ message_max

message_max
static

◆ message_min

message_min
static

◆ min

min

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