|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | __new__ (mcs, name, bases, attrs) |
| def | get_declared_fields (mcs, type klass, typing.List cls_fields, typing.List inherited_fields, type dict_cls) |
| def | __init__ (cls, name, bases, attrs) |
| typing.Dict[types.Tag, typing.List[str]] | resolve_hooks (cls) |
Metaclass for the Schema class. Binds the declared fields to a ``_declared_fields`` attribute, which is a dictionary mapping attribute names to field objects. Also sets the ``opts`` class attribute, which is the Schema class's ``class Meta`` options.
| def __init__ | ( | cls, | |
| name, | |||
| bases, | |||
| attrs | |||
| ) |
| def __new__ | ( | mcs, | |
| name, | |||
| bases, | |||
| attrs | |||
| ) |
| def get_declared_fields | ( | mcs, | |
| type | klass, | ||
| typing.List | cls_fields, | ||
| typing.List | inherited_fields, | ||
| type | dict_cls | ||
| ) |
Returns a dictionary of field_name => `Field` pairs declared on the class.
This is exposed mainly so that plugins can add additional fields, e.g. fields
computed from class Meta options.
:param klass: The class object.
:param cls_fields: The fields declared on the class, including those added
by the ``include`` class Meta option.
:param inherited_fields: Inherited fields.
:param dict_class: Either `dict` or `OrderedDict`, depending on the whether
the user specified `ordered=True`.
| typing.Dict[types.Tag, typing.List[str]] resolve_hooks | ( | cls | ) |
Add in the decorated processors By doing this after constructing the class, we let standard inheritance do all the hard work.