OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, cls_or_instance, **kwargs) |
def | format (self, value) |
def | output (self, key, data) |
![]() | |
def | __init__ (self, default=None, attribute=None) |
Data Fields | |
container | |
![]() | |
attribute | |
default | |
Field for marshalling lists of other fields. See :ref:`list-field` for more information. :param cls_or_instance: The field type the list will contain.
def __init__ | ( | self, | |
cls_or_instance, | |||
** | kwargs | ||
) |
def format | ( | self, | |
value | |||
) |
Formats a field's value. No-op by default - field classes that modify how the value of existing object keys should be presented should override this and apply the appropriate formatting. :param value: The value to format :exception MarshallingException: In case of formatting problem Ex:: class TitleCase(Raw): def format(self, value): return unicode(value).title()
Reimplemented from Raw.
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.
container |