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

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   cls,
  name,
  bases,
  attrs 
)

Member Function Documentation

◆ __new__()

def __new__ (   mcs,
  name,
  bases,
  attrs 
)

◆ get_declared_fields()

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`.

◆ resolve_hooks()

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.

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