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

Public Member Functions

def __init__ (self, nested, allow_null=False, **kwargs)
 
def output (self, key, obj)
 
- Public Member Functions inherited from Raw
def __init__ (self, default=None, attribute=None)
 
def format (self, value)
 

Data Fields

 nested
 
 allow_null
 
- Data Fields inherited from Raw
 attribute
 
 default
 

Detailed Description

Allows you to nest one set of fields inside another.
See :ref:`nested-field` for more information

:param dict nested: The dictionary to nest
:param bool allow_null: Whether to return None instead of a dictionary
    with null keys, if a nested dictionary has all-null keys
:param kwargs: If ``default`` keyword argument is present, a nested
    dictionary will be marshaled as its value if nested dictionary is
    all-null keys (e.g. lets you return an empty JSON object instead of
    null)

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  nested,
  allow_null = False,
**  kwargs 
)

Member Function Documentation

◆ output()

def output (   self,
  key,
  obj 
)
Pulls the value for the given key from the object, applies the
field's formatting and returns the result. If the key is not found
in the object, returns the default value. Field classes that create
values which do not require the existence of the key in the object
should override this and return the desired value.

:exception MarshallingException: In case of formatting problem

Reimplemented from Raw.

Field Documentation

◆ allow_null

allow_null

◆ nested

nested

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