diffsync.enum
¶
DiffSync enums and flags.
Copyright (c) 2020 Network To Code, LLC info@networktocode.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
diffsync.enum.DiffSyncActions
¶
List of valid Action for DiffSyncModel.
diffsync.enum.DiffSyncFlags
¶
Bases: Flag
Flags that can be passed to a sync_ or diff_ call to affect its behavior.
CONTINUE_ON_FAILURE = 1
class-attribute
instance-attribute
¶
Continue synchronizing even if failures are encountered when syncing individual models.
LOG_UNCHANGED_RECORDS = 8
class-attribute
instance-attribute
¶
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.
SKIP_UNMATCHED_DST = 4
class-attribute
instance-attribute
¶
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
class-attribute
instance-attribute
¶
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.
diffsync.enum.DiffSyncModelFlags
¶
Bases: Flag
Flags that can be set on a DiffSyncModel class or instance to affect its usage.
IGNORE = 1
class-attribute
instance-attribute
¶
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
class-attribute
instance-attribute
¶
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.
SKIP_CHILDREN_ON_DELETE = 2
class-attribute
instance-attribute
¶
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_DST = 8
class-attribute
instance-attribute
¶
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
class-attribute
instance-attribute
¶
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.
diffsync.enum.DiffSyncStatus
¶
Bases: Enum
Flag values to set as a DiffSyncModel's _status when performing a sync; values are logged by DiffSyncSyncer.