Package
nautobot_version_control
¶
This is the main module that contains the code for the Dolt backed Version Control plugin.
NautobotVersionControl
¶
Bases: PluginConfig
NautobotVersionControl initializes the dolt configs, middleware, and sets up migrations.
Source code in nautobot_version_control/__init__.py
diff_table_for_model(model)
¶
Returns a table object for a model, if it exists in
the __DIFF_TABLE_REGISTRY__
.
is_global_router_enabled()
¶
Returns true if the GLOBAL_ROUTER_SWITCH is turned on
is_versioned_model(model)
¶
Determines whether a model's is under version control. See MODELS_UNDER_VERSION_CONTROL for more info.
Source code in nautobot_version_control/__init__.py
query_registry(model, registry)
¶
Performs a lookup on a content type registry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
django.db.models.Model
|
a Django model class |
required |
registry |
dict
|
a python dictionary like The type of<value> is specific to each
registry. A return value of None signals
that nothing is registered for that model . |
required |
Source code in nautobot_version_control/__init__.py
register_diff_tables(registry)
¶
Register additional tables to be used in diffs. Registry values must be subclasses of django_tables2.Table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
registry |
dict
|
a python dict of content types that will be placed under version control: |
required |
Source code in nautobot_version_control/__init__.py
register_versioned_models(registry)
¶
Register additional content types to be versioned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
registry |
dict
|
a python dict of content types that will be placed under version control: |
required |