Serialization (pydent.marshaller)

This module provides speedy serialization and deserialization functionality for Trident models. Models that inherit the SchemaModel will become registered with their own serialization/deserialization schema. To register the schema, use the add_schema decorator on the class. The dump method will serialize and object while the dump method will deserialize JSON data to an object.

Note

This is only relevant to Trident developers, rather than regular users.

SchemaModel([data])

A Schema class that holds information on serialization/deserialization.

ModelRegistry(name, bases, selfdict)

Stores list of all models instantiated from the SchemaModel base.

SchemaRegistry(name, bases, selfdict)

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

descriptors

Data descriptors that provide special behaviors when attributes are accessed.

exceptions

Marshalling exceptions.

utils

Fields

Fields are descriptors that control how attributes and data is serialized/deserialized.

Alias(field_name)

A shallow alias to another field.

Callback(callback[, callback_args, …])

Make a callback when called.

Field([many, data_key, allow_none, default])

A serialization/deserialization field.

FieldABC

Field abstract base class.

Nested(nested[, many, data_key, allow_none, …])

Represents a field that returns another nested instance.

Relationship(nested, callback[, …])

A composition (Callback/Nested) field that uses a callback to retrieve a model.