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

Public Member Functions

def __init__ (self, typing.Union[str, typing.List, typing.Dict] message, str field_name=SCHEMA, typing.Optional[typing.Union[typing.Mapping[str, typing.Any], typing.Iterable[typing.Mapping[str, typing.Any]],]] data=None, typing.Optional[typing.Union[typing.List[typing.Dict[str, typing.Any]], typing.Dict[str, typing.Any],]] valid_data=None, **kwargs)
 
def normalized_messages (self)
 

Data Fields

 messages
 
 field_name
 
 data
 
 valid_data
 
 kwargs
 

Detailed Description

Raised when validation fails on a field or schema.

Validators and custom fields should raise this exception.

:param message: An error message, list of error messages, or dict of
    error messages. If a dict, the keys are subitems and the values are error messages.
:param field_name: Field name to store the error on.
    If `None`, the error is stored as schema-level error.
:param data: Raw input data.
:param valid_data: Valid (de)serialized data.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
typing.Union[str, typing.List, typing.Dict]  message,
str   field_name = SCHEMA,
typing.Optional[ typing.Union[ typing.Mapping[str, typing.Any], typing.Iterable[typing.Mapping[str, typing.Any]], ] ]   data = None,
typing.Optional[ typing.Union[ typing.List[typing.Dict[str, typing.Any]], typing.Dict[str, typing.Any], ] ]   valid_data = None,
**  kwargs 
)
Raised when validation fails on a field or schema.

Validators and custom fields should raise this exception.

:param message: An error message, list of error messages, or dict of
error messages. If a dict, the keys are subitems and the values are error messages.
:param field_name: Field name to store the error on.
If `None`, the error is stored as schema-level error.
:param data: Raw input data.
:param valid_data: Valid (de)serialized data.

Member Function Documentation

◆ normalized_messages()

def normalized_messages (   self)

Field Documentation

◆ data

data

◆ field_name

field_name

◆ kwargs

kwargs

◆ messages

messages

◆ valid_data

valid_data

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