pydent.marshaller.SchemaRegistry

class pydent.marshaller.SchemaRegistry(name, bases, selfdict)[source]

Bases: type

Stores a list of models that can be accessed by name.

Saves model to the registry.

__init__(name, bases, selfdict)[source]

Saves model to the registry.

Methods

__init__(name, bases, selfdict)

Saves model to the registry.

get_model_schema(model_name)

Gets a model schema from a model name.

get_schema(name)

Gets model by model_name.

make_schema_name(name)

Makes a Schema class name from a model name (appending ‘Schema’ to name)

mro

Return a type’s method resolution order.

Attributes

BASE

fields

The shcmea fields.

grouped_fields

Fields grouped by their base classes.

model_class

The registered model class.

schemas

property fields

The shcmea fields.

static get_model_schema(model_name)[source]

Gets a model schema from a model name.

static get_schema(name)[source]

Gets model by model_name.

property grouped_fields

Fields grouped by their base classes.

Returns empty list of base class not in fields.

static make_schema_name(name)[source]

Makes a Schema class name from a model name (appending ‘Schema’ to name)

property model_class

The registered model class.

mro()

Return a type’s method resolution order.