diffsync.enum

DiffSync enums and flags.

class diffsync.enum.DiffSyncActions

Bases: object

List of valid Action for DiffSyncModel.

CREATE = 'create'
DELETE = 'delete'
NO_CHANGE = None
SKIP = 'skip'
UPDATE = 'update'
class diffsync.enum.DiffSyncFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Flag

Flags that can be passed to a sync_* or diff_* call to affect its behavior.

CONTINUE_ON_FAILURE = 1

Continue synchronizing even if failures are encountered when syncing individual models.

LOG_UNCHANGED_RECORDS = 8

If this flag is set, a log message will be generated during synchronization for each model, even unchanged ones.

By default, when this flag is unset, only models that have actual changes to synchronize will be logged. This flag is off by default to reduce the default verbosity of DiffSync, but can be enabled when debugging.

NONE = 0
SKIP_UNMATCHED_BOTH = 6
SKIP_UNMATCHED_DST = 4

Ignore objects that only exist in the target/”to” DiffSync when determining diffs and syncing.

If this flag is set, no objects will be deleted from the target/”to” DiffSync.

SKIP_UNMATCHED_SRC = 2

Ignore objects that only exist in the source/”from” DiffSync when determining diffs and syncing.

If this flag is set, no new objects will be created in the target/”to” DiffSync.

class diffsync.enum.DiffSyncModelFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Flag

Flags that can be set on a DiffSyncModel class or instance to affect its usage.

IGNORE = 1

Do not render diffs containing this model; do not make any changes to this model when synchronizing.

Can be used to indicate a model instance that exists but should not be changed by DiffSync.

NATURAL_DELETION_ORDER = 16

When deleting, delete children before instances of this this element.

If this flag is set, the models children will be deleted from the target/”to” DiffSync before the models instances themselves.

NONE = 0
SKIP_CHILDREN_ON_DELETE = 2

When deleting this model, do not recursively delete its children.

Can be used for the case where deletion of a model results in the automatic deletion of all its children.

SKIP_UNMATCHED_BOTH = 12
SKIP_UNMATCHED_DST = 8

Ignore the model if it only exists in the target/”to” DiffSync when determining diffs and syncing.

If this flag is set, the model will not be deleted from the target/”to” DiffSync.

SKIP_UNMATCHED_SRC = 4

Ignore the model if it only exists in the source/”from” DiffSync when determining diffs and syncing.

If this flag is set, no new model will be created in the target/”to” DiffSync.

class diffsync.enum.DiffSyncStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Flag values to set as a DiffSyncModel’s _status when performing a sync; values are logged by DiffSyncSyncer.

ERROR = 'error'
FAILURE = 'failure'
SUCCESS = 'success'
UNKNOWN = 'unknown'