Model class reference

This document covers features of the Model class.

Model

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

Model is foundation for every transformation

Each non-abstract Model class must have a Manager instance added to it. Data-migrator ensures that in your model class you have at least a standard SimpleManager specified. If you add your own Manager instance attribute, the default one does not appear.

objects

reference to manager

emit(escaper=None)

output and escape this object instance to a dict.

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

Note

HiddenFields are not emitted

save()

Save this object and add it to the list.

Returns:self, so that methods can be chained
scan(row)

scan model from row based on field definition scanners.

Returns:self, so that methods can be chained

ModelBase

class data_migrator.models.base.ModelBase

Metaclass for all models.

Note

the model structure is the foundation of data-migrator and is taken from Django (https://github.com/django/django)