Model class reference

This document covers features of the Model class.

Attributes

objects

Model.objects

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 default SimpleManager specified. If you don’t add your own Manager, Django will add an attribute objects containing default SimpleManager instance. If you add your own Manager instance attribute, the default one does not appear.

Methods

scan(row)

Model.scan(row)

Take a row and set values based on the field definitions. All fields in the field definitions are parsed. If field index does not exist an IndexError will be raised.

Returns self so it can be chained

save()

Model.save()

Save this object and add it to the list.

Returns self so it can be chained

emit(escaper)

Model.emit(escaper=None)

Emit the existing object, apply all field translations. Might raise exceptions due to validations.

Returns a dict with the translated values