OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, errors=()) |
def | __contains__ (self, index) |
def | __getitem__ (self, index) |
def | __setitem__ (self, index, value) |
def | __iter__ (self) |
def | __len__ (self) |
def | __repr__ (self) |
def | total_errors (self) |
Data Fields | |
errors | |
ErrorTrees make it easier to check which validations failed.
def __init__ | ( | self, | |
errors = () |
|||
) |
def __contains__ | ( | self, | |
index | |||
) |
Check whether ``instance[index]`` has any errors.
def __getitem__ | ( | self, | |
index | |||
) |
Retrieve the child tree one level down at the given ``index``. If the index is not in the instance that this tree corresponds to and is not known by this tree, whatever error would be raised by ``instance.__getitem__`` will be propagated (usually this is some subclass of `exceptions.LookupError`.
def __iter__ | ( | self | ) |
Iterate (non-recursively) over the indices in the instance with errors.
def __len__ | ( | self | ) |
Return the `total_errors`.
def __repr__ | ( | self | ) |
def __setitem__ | ( | self, | |
index, | |||
value | |||
) |
Add an error to the tree at the given ``index``.
def total_errors | ( | self | ) |
The total number of errors in the entire tree, including children.
errors |