OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, nested, allow_null=False, **kwargs) |
def | output (self, key, obj) |
![]() | |
def | __init__ (self, default=None, attribute=None) |
def | format (self, value) |
Data Fields | |
nested | |
allow_null | |
![]() | |
attribute | |
default | |
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)
def __init__ | ( | self, | |
nested, | |||
allow_null = False , |
|||
** | kwargs | ||
) |
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.
allow_null |
nested |