Model class reference

This document covers features of the Model class.


class data_migrator.models.base.Model(**kwargs)

Model is foundation for every transformation.

Each non-abstract Model class must have a BaseManager instance added to it. data-migrator ensures that in your model class you have at least a standard SimpleManager specified, on case you do add your own specialization of BaseManager through the Meta class manager attribute.


reference to manager


output and escape this object instance to a dict.

Returns:object transfored according to field definitions
Return type:map


HiddenFields are not emitted

classmethod json_schema()

generate the json schema representation of this model.

Returns:dict with python representation of json schema.

Save this object and add it to the list.

Returns:self, so that methods can be chained

scan model from row based on field definition scanners.

Returns:self, so that methods can be chained

Update method for chaining operations.

Returns:self, so that methods can be chained
Raises:DataException – raised if trying to set non defined field and strict model.


class data_migrator.models.base.ModelBase

Metaclass for all models.


the model structure is the foundation of data-migrator and is taken from Django (