Meta class reference

This document covers features of the Meta class. The meta class defines model specific settings.

Note

Technically, Meta is just a container and forwarded to data-migrator.models.options.Options

Field options

The following arguments are available to all field types. All are optional.

drop_if_none

Meta.drop_if_none

Is a list of field names as defined. If set data-migrator will check if fields are not None and drop if one of the columns is.

Any field listed in this attribute is checked after scanning and just before save-ing.

Note

Note that only NullXXXFields actually can be None after scanning and parsing. Non Null fields are set to their default value.

drop_non_unique

Meta.drop_non_unique

If True, data-migrator will drop values if the column uniqueness check fails (after parsing). Default is False.

Any field can be defined as a unique column. Any field set so, is checked after scanning and just before save-ing.

emitter

Meta.emitter

If set, data-migrator will use this emitter instead of the default emitter.

fail_non_unique

Meta.fail_non_unique

If True, data-migrator will fail as a whole if the column uniqueness check fails (after parsing). Default is False.

Any field can be defined as a unique column. Any field set so, is checked after scanning and just before save-ing.

fail_non_validated

Meta.fail_non_validated

If True, data-migrator will fail as a whole if the column validation check fails (after parsing). Default is False.

Any field can have its own validator, this is a rough method to prevent bad data from being transformed and loaded.

file_name

Meta.file_name

If set, data-migrator will use this as file_name for the emitter instead of the default filename based on table_name.

table_name

Meta.table_name

If set, data-migrator will use this as table_name for the emitter instead of the default tablename based on model_name.

prefix

Meta.prefix

If set, data-migrator will use this list of statements as a preamble in the generation of the output statements. By default an emitter uses this to clear the old records.

remark

Meta.remark

If set, data-migrator will use this as the remark attribute in the Model, default=’remark’. Use this for example if you have a remark field in your model and need to free the keyword.

manager

Meta.manager

If set, data-migrator will use this as the manager for this model. This is useful if the transform method needs to be overridden.