diff --git a/.yamllint.yml b/.yamllint.yml
index 6eff02c0..8f4a44ac 100644
--- a/.yamllint.yml
+++ b/.yamllint.yml
@@ -12,3 +12,5 @@ ignore: |
.venv/
nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml
nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml
+ nautobot-app-ssot/{{ cookiecutter.project_slug }}/invoke.mysql.yml
+ nautobot-app-ssot/{{ cookiecutter.project_slug }}/invoke.example.yml
diff --git a/nautobot-app-ssot/README.md b/nautobot-app-ssot/README.md
index 1f05225f..57d9f1ec 100644
--- a/nautobot-app-ssot/README.md
+++ b/nautobot-app-ssot/README.md
@@ -10,7 +10,7 @@ The term SSoT, or Single Source of Truth, refers to the intention of using Nauto
### IMPORTANT Cookie Notes
-- The logo of the project is a placeholder (`docs/images/icon-{{cookiecutter.plugin_slug}}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
+- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.plugin_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
- Please resolve and remove **all** of the comments and blocks marked with `Developer Note - Remove Me!` prior to publishing the documentation. Catch'em all with `rgrep "Developer Note"`.
- The documentation website will be built and hosted on `readthedocs.io` for open source projects and follows the standard Network to Code branding for all our open source projects.
diff --git a/nautobot-app-ssot/cookiecutter.json b/nautobot-app-ssot/cookiecutter.json
index 30edc8e2..40457bbf 100644
--- a/nautobot-app-ssot/cookiecutter.json
+++ b/nautobot-app-ssot/cookiecutter.json
@@ -4,23 +4,23 @@
"email": "info@networktocode.com",
"github_org": "nautobot",
"system_of_record": "System of Record",
- "system_of_record_camel": "{{cookiecutter.system_of_record.title().replace(' ', '').replace('_', '').replace('-', '')}}",
- "system_of_record_slug": "{{cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_')}}",
- "plugin_name": "nautobot_ssot_{{cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_')}}",
- "verbose_name": "{{cookiecutter.plugin_name.title().replace('_', ' ')}}",
- "plugin_slug": "{{cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-')}}",
- "project_slug": "nautobot-plugin-ssot-{{cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-')}}",
- "repo_url": "https://github.com/{{cookiecutter.github_org}}/{{cookiecutter.project_slug}}",
- "base_url": "ssot-{{cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-')}}",
- "min_nautobot_version": "1.6.0",
- "max_nautobot_version": "1.9999",
- "camel_name": "{{cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '')}}",
- "project_short_description": "{{cookiecutter.verbose_name}}",
+ "system_of_record_camel": "{{ cookiecutter.system_of_record.title().replace(' ', '').replace('_', '').replace('-', '') }}",
+ "system_of_record_slug": "{{ cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_') }}",
+ "plugin_name": "nautobot_ssot_{{ cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_') }}",
+ "verbose_name": "{{ cookiecutter.plugin_name.title().replace('_', ' ') }}",
+ "plugin_slug": "{{ cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-') }}",
+ "project_slug": "nautobot-plugin-ssot-{{ cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-') }}",
+ "repo_url": "https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}",
+ "base_url": "ssot-{{ cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-') }}",
+ "min_nautobot_version": "2.0.0",
+ "max_nautobot_version": "2.9999",
+ "camel_name": "{{ cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '') }}",
+ "project_short_description": "{{ cookiecutter.verbose_name }}",
"model_class_name": "None",
"open_source_license": [
"Apache-2.0",
"Not open source"
],
"docs_base_url": "https://docs.nautobot.com",
- "docs_app_url": "{{cookiecutter.docs_base_url}}/projects/{{cookiecutter.plugin_slug}}/en/latest"
+ "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.plugin_slug }}/en/latest"
}
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md
index 7714ef76..aed494fc 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md
@@ -1,4 +1,4 @@
-# {{cookiecutter.verbose_name}} SSoT
+# {{ cookiecutter.verbose_name }} SSoT
A plugin for [Nautobot](https://github.com/nautobot/nautobot).
@@ -9,18 +9,18 @@ Developer Note - Remove Me!
The README will have certain links/images broken until the PR is merged into `develop`. Update the GitHub links with whichever branch you're using (main etc.) if different.
-The logo of the project is a placeholder (docs/images/icon-{{cookiecutter.plugin_slug}}.png) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
+The logo of the project is a placeholder (docs/images/icon-{{ cookiecutter.plugin_slug }}.png) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
To avoid extra work and temporary links, make sure that publishing docs (or merging a PR) is done at the same time as setting up the docs site on RTD, then test everything.
-->
-
+
-
-
-
-
+
+
+
+
An App for Nautobot.
@@ -35,9 +35,9 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg
> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/plugin-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI.
-More screenshots can be found in the [Using the App]({{cookiecutter.docs_app_url}}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality:
+More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality:
-![](https://raw.githubusercontent.com/{{cookiecutter.github_org}}/{{cookiecutter.project_slug}}/develop/docs/images/placeholder.png)
+![](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/placeholder.png)
## Try it out!
@@ -49,22 +49,22 @@ This App is installed in the Nautobot Community Sandbox found over at [demo.naut
## Documentation
-Full documentation for this App can be found over on the [Nautobot Docs]({{cookiecutter.docs_base_url}}) website:
+Full documentation for this App can be found over on the [Nautobot Docs]({{ cookiecutter.docs_base_url }}) website:
-- [User Guide]({{cookiecutter.docs_app_url}}/user/app_overview/) - Overview, Using the App, Getting Started.
-- [Administrator Guide]({{cookiecutter.docs_app_url}}/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
-- [Developer Guide]({{cookiecutter.docs_app_url}}/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
-- [Release Notes / Changelog]({{cookiecutter.docs_app_url}}/admin/release_notes/).
-- [Frequently Asked Questions]({{cookiecutter.docs_app_url}}/user/faq/).
+- [User Guide]({{ cookiecutter.docs_app_url }}/user/app_overview/) - Overview, Using the App, Getting Started.
+- [Administrator Guide]({{ cookiecutter.docs_app_url }}/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
+- [Developer Guide]({{ cookiecutter.docs_app_url }}/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
+- [Release Notes / Changelog]({{ cookiecutter.docs_app_url }}/admin/release_notes/).
+- [Frequently Asked Questions]({{ cookiecutter.docs_app_url }}/user/faq/).
### Contributing to the Documentation
-You can find all the Markdown source for the App documentation under the [`docs`]({{cookiecutter.repo_url}}/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
+You can find all the Markdown source for the App documentation under the [`docs`]({{ cookiecutter.repo_url }}/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
-If you need to view the fully-generated documentation site, you can build it with [MkDocs](https://www.mkdocs.org/). A container hosting the documentation can be started using the `invoke` commands (details in the [Development Environment Guide]({{cookiecutter.docs_app_url}}/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). Using this container, as your changes to the documentation are saved, they will be automatically rebuilt and any pages currently being viewed will be reloaded in your browser.
+If you need to view the fully-generated documentation site, you can build it with [MkDocs](https://www.mkdocs.org/). A container hosting the documentation can be started using the `invoke` commands (details in the [Development Environment Guide]({{ cookiecutter.docs_app_url }}/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). Using this container, as your changes to the documentation are saved, they will be automatically rebuilt and any pages currently being viewed will be reloaded in your browser.
Any PRs with fixes or improvements are very welcome!
## Questions
-For any questions or comments, please check the [FAQ]({{cookiecutter.docs_app_url}}/user/faq/) first. Feel free to also swing by the [Network to Code Slack](https://networktocode.slack.com/) (channel `#nautobot`), sign up [here](http://slack.networktocode.com/) if you don't have an account.
+For any questions or comments, please check the [FAQ]({{ cookiecutter.docs_app_url }}/user/faq/) first. Feel free to also swing by the [Network to Code Slack](https://networktocode.slack.com/) (channel `#nautobot`), sign up [here](http://slack.networktocode.com/) if you don't have an account.
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py
index 4b6826c0..15711d37 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py
@@ -131,7 +131,7 @@
# Enable installed Apps. Add the name of each App to the list.
PLUGINS = [
"nautobot_ssot",
- "{{cookiecutter.plugin_name}}",
+ "{{ cookiecutter.plugin_name }}",
]
# Apps configuration settings. These settings are used by various Apps that the user may have installed.
@@ -140,7 +140,7 @@
"nautobot_ssot": {
"hide_example_jobs": True,
},
- # '{{cookiecutter.plugin_name}}': {
+ # '{{ cookiecutter.plugin_name }}': {
# 'foo': 'bar',
# 'buzz': 'bazz',
# },
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md
index 0c730184..b3c59c05 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md
@@ -7,7 +7,7 @@ Here you will find detailed instructions on how to **install** and **configure**
## Prerequisites
-- The plugin is compatible with Nautobot {{cookiecutter.min_nautobot_version}} and higher.
+- The plugin is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher.
- Databases supported: PostgreSQL, MySQL
!!! note
@@ -21,37 +21,37 @@ Here you will find detailed instructions on how to **install** and **configure**
## Install Guide
!!! note
- Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{cookiecutter.plugin_slug}}`](https://pypi.org/project/{{cookiecutter.plugin_slug}}/).
+ Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{ cookiecutter.plugin_slug }}`](https://pypi.org/project/{{ cookiecutter.plugin_slug }}/).
The plugin is available as a Python package via PyPI and can be installed with `pip`:
```shell
-pip install {{cookiecutter.plugin_slug}}
+pip install {{ cookiecutter.plugin_slug }}
```
-To ensure {{cookiecutter.verbose_name}} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{cookiecutter.plugin_slug}}` package:
+To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.plugin_slug }}` package:
```shell
-echo {{cookiecutter.plugin_slug}} >> local_requirements.txt
+echo {{ cookiecutter.plugin_slug }} >> local_requirements.txt
```
Once installed, the plugin needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file:
-- Append `"{{cookiecutter.plugin_name}}"` to the `PLUGINS` list.
-- Append the `"{{cookiecutter.plugin_name}}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.
+- Append `"{{ cookiecutter.plugin_name }}"` to the `PLUGINS` list.
+- Append the `"{{ cookiecutter.plugin_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.
```python
# In your nautobot_config.py
PLUGINS = [
"nautobot_ssot",
- "{{cookiecutter.plugin_name}}",
+ "{{ cookiecutter.plugin_name }}",
]
PLUGINS_CONFIG = {
"nautobot_ssot": {
"hide_example_jobs": True,
},
- '{{cookiecutter.plugin_name}}': {
+ '{{ cookiecutter.plugin_name }}': {
# ADD YOUR SETTINGS HERE
},
}
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png
new file mode 120000
index 00000000..96fd7ffa
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png
deleted file mode 120000
index 9f10b533..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml
index 5aadf32c..75c8ca82 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml
@@ -1,14 +1,14 @@
[tool.poetry]
-name = "{{cookiecutter.plugin_slug}}"
+name = "{{ cookiecutter.plugin_slug }}"
version = "0.1.0"
-description = "{{cookiecutter.project_short_description}}"
-authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"]
+description = "{{ cookiecutter.project_short_description }}"
+authors = ["{{ cookiecutter.full_name }} <{{ cookiecutter.email }}>"]
{%- if cookiecutter.open_source_license == 'Apache-2.0' %}
-license = "{{cookiecutter.open_source_license}}"
+license = "{{ cookiecutter.open_source_license }}"
{%- endif %}
readme = "README.md"
-homepage = "{{cookiecutter.repo_url}}"
-repository = "{{cookiecutter.repo_url}}"
+homepage = "{{ cookiecutter.repo_url }}"
+repository = "{{ cookiecutter.repo_url }}"
keywords = ["nautobot", "nautobot-plugin"]
classifiers = [
"Intended Audience :: Developers",
@@ -26,14 +26,14 @@ include = [
"README.md",
]
packages = [
- { include = "{{cookiecutter.plugin_name}}" },
+ { include = "{{ cookiecutter.plugin_name }}" },
]
[tool.poetry.dependencies]
python = ">=3.8,<3.12"
# Used for local development
-nautobot = "^{{cookiecutter.min_nautobot_version}}"
-nautobot-ssot = "^1.1.0"
+nautobot = "^{{ cookiecutter.min_nautobot_version }}"
+nautobot-ssot = "^2.0.0"
[tool.poetry.group.dev.dependencies]
bandit = "*"
@@ -60,6 +60,10 @@ mkdocs-version-annotations = "1.0.0"
mkdocstrings = "0.22.0"
mkdocstrings-python = "1.5.2"
+[tool.poetry.extras]
+all = [
+]
+
[tool.black]
line-length = 120
target-version = ['py38', 'py39', 'py310', 'py311']
@@ -108,7 +112,7 @@ notes = """,
[tool.pylint-nautobot]
supported_nautobot_versions = [
- "{{cookiecutter.min_nautobot_version}}"
+ "{{ cookiecutter.min_nautobot_version }}"
]
[tool.pydocstyle]
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py
new file mode 120000
index 00000000..06575aff
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py
new file mode 120000
index 00000000..9c7aa994
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py
new file mode 120000
index 00000000..ffed85ab
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
new file mode 120000
index 00000000..2b30ed95
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
new file mode 120000
index 00000000..1328b5b9
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/__init__.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/__init__.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/__init__.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/nautobot.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/nautobot.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/nautobot.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/__init__.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/__init__.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/__init__.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/base.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/base.py
similarity index 92%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/base.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/base.py
index eb6d9dc8..360b82c7 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/base.py
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/base.py
@@ -13,7 +13,7 @@ class Device(DiffSyncModel):
"status",
"role",
"model",
- "site",
+ "location",
"ip_address",
)
_children = {}
@@ -22,7 +22,7 @@ class Device(DiffSyncModel):
status: Optional[str]
role: Optional[str]
model: Optional[str]
- site: Optional[str]
+ location: Optional[str]
ip_address: Optional[str]
uuid: Optional[UUID]
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py
similarity index 52%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/nautobot.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py
index 3fd8a19e..7beea1fa 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/nautobot.py
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py
@@ -1,12 +1,26 @@
"""Nautobot DiffSync models for {{ cookiecutter.system_of_record }} SSoT."""
-from diffsync import DiffSyncModel
+from django.contrib.contenttypes.models import ContentType
-from nautobot.dcim.models import Device as NewDevice
-from nautobot.dcim.models import Site, DeviceRole, DeviceType
-from nautobot.extras.models import Status
+from nautobot.dcim.models import Device as NewDevice, Location, LocationType, DeviceType
+from nautobot.extras.models import Status, Role
from {{ cookiecutter.plugin_name }}.diffsync.models.base import Device
+def ensure_location(location_name):
+ """Safely returns a Location with a LocationType that support Devices."""
+ location_type, _ = LocationType.objects.get_or_create(name="Site")
+ content_type = ContentType.objects.get_for_model(NewDevice)
+ location_type.content_types.add(content_type)
+ status = Status.objects.get(name="Active")
+ return Location.objects.get_or_create(name=location_name, location_type=location_type, status=status)[0]
+
+def ensure_role(role_name):
+ """Safely returns a Role that support Devices."""
+ content_type = ContentType.objects.get_for_model(NewDevice)
+ role, _ = Role.objects.get_or_create(name=role_name)
+ role.content_types.add(content_type)
+ return role
+
class NautobotDevice(Device):
"""Nautobot implementation of {{ cookiecutter.system_of_record }} Device model."""
@@ -17,8 +31,8 @@ def create(cls, diffsync, ids, attrs):
name=ids["name"],
device_type=DeviceType.objects.get_or_create(model=attrs["model"])[0],
status=Status.objects.get_or_create(name=attrs["status"])[0],
- device_role=DeviceRole.objects.get_or_create(name=attrs["role"])[0],
- site=Site.objects.get_or_create(name=attrs["site"])[0],
+ role=ensure_role(attrs["role"]),
+ location=ensure_location(attrs["location"]),
)
new_device.validated_save()
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
@@ -29,9 +43,9 @@ def update(self, attrs):
if "status" in attrs:
device.status = Status.objects.get_or_create(name=attrs["status"])[0]
if "role" in attrs:
- device.device_role = DeviceRole.objects.get_or_create(name=attrs["role"])[0]
- if "site" in attrs:
- device.site = Site.objects.get_or_create(name=attrs["site"])[0]
+ device.role = ensure_role(attrs["role"])
+ if "location" in attrs:
+ device.location = ensure_location(attrs["location"])
device.validated_save()
return super().update(attrs)
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
new file mode 120000
index 00000000..602d5a64
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
new file mode 120000
index 00000000..dbe36562
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/jobs.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/jobs.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/jobs.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/jobs.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py
new file mode 120000
index 00000000..e1aa7c68
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
new file mode 120000
index 00000000..3ba1e8ef
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
new file mode 120000
index 00000000..22a83ad8
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
new file mode 120000
index 00000000..7a68c7c4
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html
new file mode 120000
index 00000000..1fcbf878
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html
@@ -0,0 +1 @@
+../../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py
new file mode 120000
index 00000000..34ead0b6
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
new file mode 120000
index 00000000..0aa7332e
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures/get_devices.json b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures/get_devices.json
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
new file mode 120000
index 00000000..c052b216
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
new file mode 120000
index 00000000..ca2d630e
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py
new file mode 120000
index 00000000..44de1fc1
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
new file mode 120000
index 00000000..777fc6d8
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
new file mode 120000
index 00000000..596ef71a
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
new file mode 120000
index 00000000..9f6fabf7
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py
new file mode 120000
index 00000000..0423c9d9
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py
@@ -0,0 +1 @@
+../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py
similarity index 93%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py
index 5a0859f5..004a1a21 100644
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py
@@ -6,7 +6,7 @@
from django.contrib.contenttypes.models import ContentType
from nautobot.extras.models import Job, JobResult
-from nautobot.utilities.testing import TransactionTestCase
+from nautobot.core.testing import TransactionTestCase
from {{ cookiecutter.plugin_name }}.diffsync.adapters.{{ cookiecutter.system_of_record_slug }} import {{ cookiecutter.system_of_record_camel }}Adapter
from {{ cookiecutter.plugin_name }}.jobs import {{ cookiecutter.system_of_record_camel }}DataSource
@@ -17,7 +17,7 @@ def load_json(path):
return json.loads(file.read())
-DEVICE_FIXTURE = load_json("./{{ cookiecutter.plugin_name }}/tests/fixtures/fixtures/get_devices.json")
+DEVICE_FIXTURE = load_json("./{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json")
class Test{{ cookiecutter.system_of_record_camel }}AdapterTestCase(TransactionTestCase):
@@ -25,7 +25,7 @@ class Test{{ cookiecutter.system_of_record_camel }}AdapterTestCase(TransactionTe
databases = ("default", "job_logs")
- def setUp(self):
+ def setUp(self): # pylint: disable=invalid-name
"""Initialize test case."""
self.{{ cookiecutter.system_of_record_slug }}_client = MagicMock()
self.{{ cookiecutter.system_of_record_slug }}_client.get_devices.return_value = DEVICE_FIXTURE
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py
new file mode 120000
index 00000000..601b0293
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/__init__.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/__init__.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/__init__.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/nautobot.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/nautobot.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/nautobot.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py
similarity index 100%
rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/utils/{{ cookiecutter.system_of_record_slug }}.py
rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py
new file mode 120000
index 00000000..fff61ea4
--- /dev/null
+++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py
@@ -0,0 +1 @@
+../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py
deleted file mode 120000
index 095b3119..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py
deleted file mode 120000
index 4f321064..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py
deleted file mode 120000
index 9d357efd..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py
deleted file mode 120000
index 69d9969f..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py
deleted file mode 120000
index f00ac209..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py
deleted file mode 120000
index 41d7c8e4..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py
deleted file mode 120000
index 71fe9b1f..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py
deleted file mode 120000
index 3eead31d..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py
deleted file mode 120000
index 907f7543..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py
deleted file mode 120000
index 2ecd6ece..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py
deleted file mode 120000
index 66a6198d..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py
deleted file mode 120000
index fe83e26e..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html
deleted file mode 120000
index 0fca0264..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py
deleted file mode 120000
index 3b4a0b03..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py
deleted file mode 120000
index c7e7d8f9..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py
deleted file mode 120000
index 32f136d8..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py
deleted file mode 120000
index a508daa1..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py
deleted file mode 120000
index 1fb7ce6e..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
deleted file mode 120000
index c7448621..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
deleted file mode 120000
index 50ce42a5..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
deleted file mode 120000
index f7eea113..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py
deleted file mode 120000
index 3e481176..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py
deleted file mode 120000
index ddc8bbc2..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py
\ No newline at end of file
diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py
deleted file mode 120000
index 8c99e6be..00000000
--- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py
\ No newline at end of file
diff --git a/nautobot-app/README.md b/nautobot-app/README.md
index 8d229352..fd9df0e9 100644
--- a/nautobot-app/README.md
+++ b/nautobot-app/README.md
@@ -8,7 +8,7 @@ This folder provides a Cookiecutter template for a Nautobot App that adheres to
### IMPORTANT Cookie Notes
-- The logo of the project is a placeholder (`docs/images/icon-{{cookiecutter.plugin_slug}}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
+- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.plugin_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background!
- Please resolve and remove **all** of the comments and blocks marked with `Developer Note - Remove Me!` prior to publishing the documentation. Catch'em all with `rgrep "Developer Note"`.
- The documentation website will be built and hosted on `readthedocs.io` for open source projects and follows the standard Network to Code branding for all our open source projects.
diff --git a/nautobot-app/cookiecutter.json b/nautobot-app/cookiecutter.json
index 641e9912..1ed231ca 100644
--- a/nautobot-app/cookiecutter.json
+++ b/nautobot-app/cookiecutter.json
@@ -4,20 +4,20 @@
"email": "info@networktocode.com",
"github_org": "nautobot",
"plugin_name": "my_plugin",
- "verbose_name": "{{cookiecutter.plugin_name.title().replace('_', ' ')}}",
- "plugin_slug": "{{cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-')}}",
- "project_slug": "nautobot-plugin-{{cookiecutter.plugin_slug}}",
- "repo_url": "https://github.com/{{cookiecutter.github_org}}/{{cookiecutter.project_slug}}",
- "base_url": "{{cookiecutter.plugin_slug}}",
- "min_nautobot_version": "1.6.0",
- "max_nautobot_version": "1.9999",
- "camel_name": "{{cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '')}}",
- "project_short_description": "{{cookiecutter.verbose_name}}",
+ "verbose_name": "{{ cookiecutter.plugin_name.title().replace('_', ' ') }}",
+ "plugin_slug": "{{ cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-') }}",
+ "project_slug": "nautobot-plugin-{{ cookiecutter.plugin_slug }}",
+ "repo_url": "https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}",
+ "base_url": "{{ cookiecutter.plugin_slug }}",
+ "min_nautobot_version": "2.0.0",
+ "max_nautobot_version": "2.9999",
+ "camel_name": "{{ cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '') }}",
+ "project_short_description": "{{ cookiecutter.verbose_name }}",
"model_class_name": "None",
"open_source_license": [
"Apache-2.0",
"Not open source"
],
"docs_base_url": "https://docs.nautobot.com",
- "docs_app_url": "{{cookiecutter.docs_base_url}}/projects/{{cookiecutter.plugin_slug}}/en/latest"
+ "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.plugin_slug }}/en/latest"
}
\ No newline at end of file
diff --git a/nautobot-app/hooks/post_gen_project.py b/nautobot-app/hooks/post_gen_project.py
index 62b0361d..d90caff1 100644
--- a/nautobot-app/hooks/post_gen_project.py
+++ b/nautobot-app/hooks/post_gen_project.py
@@ -14,6 +14,7 @@
* cp development/creds.example.env development/creds.env
* poetry shell
* invoke makemigrations
+* black . # this will ensure all python files are formatted correctly, may require `sudo chown -R ./` as migrations may be owned by root
The file `creds.env` will be ignored by git and can be used to override default environment variables.
"""
@@ -25,7 +26,6 @@
if "{{ cookiecutter.model_class_name }}" == "None":
files_to_remove = [
"api/__init__.py",
- "api/nested_serializers.py",
"api/serializers.py",
"api/urls.py",
"api/views.py",
@@ -35,7 +35,7 @@
"models.py",
"navigation.py",
"tables.py",
- "templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name.lower() }}.html",
+ "templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name.lower() }}_retrieve.html",
"tests/fixtures.py",
"tests/test_api_views.py",
"tests/test_filter_{{ cookiecutter.model_class_name.lower() }}.py",
@@ -43,7 +43,7 @@
"tests/test_model_{{ cookiecutter.model_class_name.lower() }}.py",
"tests/test_views.py",
"urls.py",
- "views/{{ cookiecutter.model_class_name.lower() }}.py",
+ "views.py",
]
for file in files_to_remove:
(_ADDONS_PATH / file).unlink()
@@ -52,13 +52,12 @@
"migrations",
"templates/{{ cookiecutter.plugin_name }}",
"templates",
- "views",
]
for folder in folders_to_remove:
(_ADDONS_PATH / folder).rmdir()
# Persist the baked cookie parameters in-repo for future usage as a replay file or for the drift management.
- cookie = {{cookiecutter}}
+ cookie = {{ cookiecutter }}
(_PROJECT_PATH / ".cookiecutter.json").write_text(
json.dumps({"cookiecutter": cookie}, indent=4) + "\n", encoding="utf-8"
)
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md
index b6b22d62..acca3ff4 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,12 +1,12 @@
---
name: 🐛 Bug Report
-about: Report a reproducible bug in the current release of {{cookiecutter.plugin_slug}}
+about: Report a reproducible bug in the current release of {{ cookiecutter.plugin_slug }}
---
### Environment
* Python version:
-* Nautobot version:
-* {{cookiecutter.plugin_slug}} version:
+* Nautobot version:
+* {{ cookiecutter.plugin_slug }} version:
### Expected Behavior
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md
index 6034a008..4c6af8fa 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md
@@ -5,8 +5,8 @@ about: Propose a new feature or enhancement
---
### Environment
-* Nautobot version:
-* {{cookiecutter.plugin_slug}} version:
+* Nautobot version:
+* {{ cookiecutter.plugin_slug }} version:
-
+
-
-
-
-
+
+
+
+
An App for Nautobot.
@@ -31,9 +31,9 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg
> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/plugin-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI.
-More screenshots can be found in the [Using the App]({{cookiecutter.docs_app_url}}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality:
+More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality:
-![](https://raw.githubusercontent.com/{{cookiecutter.github_org}}/{{cookiecutter.project_slug}}/develop/docs/images/placeholder.png)
+![](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/placeholder.png)
## Try it out!
@@ -45,22 +45,22 @@ This App is installed in the Nautobot Community Sandbox found over at [demo.naut
## Documentation
-Full documentation for this App can be found over on the [Nautobot Docs]({{cookiecutter.docs_base_url}}) website:
+Full documentation for this App can be found over on the [Nautobot Docs]({{ cookiecutter.docs_base_url }}) website:
-- [User Guide]({{cookiecutter.docs_app_url}}/user/app_overview/) - Overview, Using the App, Getting Started.
-- [Administrator Guide]({{cookiecutter.docs_app_url}}/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
-- [Developer Guide]({{cookiecutter.docs_app_url}}/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
-- [Release Notes / Changelog]({{cookiecutter.docs_app_url}}/admin/release_notes/).
-- [Frequently Asked Questions]({{cookiecutter.docs_app_url}}/user/faq/).
+- [User Guide]({{ cookiecutter.docs_app_url }}/user/app_overview/) - Overview, Using the App, Getting Started.
+- [Administrator Guide]({{ cookiecutter.docs_app_url }}/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
+- [Developer Guide]({{ cookiecutter.docs_app_url }}/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
+- [Release Notes / Changelog]({{ cookiecutter.docs_app_url }}/admin/release_notes/).
+- [Frequently Asked Questions]({{ cookiecutter.docs_app_url }}/user/faq/).
### Contributing to the Documentation
-You can find all the Markdown source for the App documentation under the [`docs`]({{cookiecutter.repo_url}}/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
+You can find all the Markdown source for the App documentation under the [`docs`]({{ cookiecutter.repo_url }}/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
-If you need to view the fully-generated documentation site, you can build it with [MkDocs](https://www.mkdocs.org/). A container hosting the documentation can be started using the `invoke` commands (details in the [Development Environment Guide]({{cookiecutter.docs_app_url}}/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). Using this container, as your changes to the documentation are saved, they will be automatically rebuilt and any pages currently being viewed will be reloaded in your browser.
+If you need to view the fully-generated documentation site, you can build it with [MkDocs](https://www.mkdocs.org/). A container hosting the documentation can be started using the `invoke` commands (details in the [Development Environment Guide]({{ cookiecutter.docs_app_url }}/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). Using this container, as your changes to the documentation are saved, they will be automatically rebuilt and any pages currently being viewed will be reloaded in your browser.
Any PRs with fixes or improvements are very welcome!
## Questions
-For any questions or comments, please check the [FAQ]({{cookiecutter.docs_app_url}}/user/faq/) first. Feel free to also swing by the [Network to Code Slack](https://networktocode.slack.com/) (channel `#nautobot`), sign up [here](http://slack.networktocode.com/) if you don't have an account.
+For any questions or comments, please check the [FAQ]({{ cookiecutter.docs_app_url }}/user/faq/) first. Feel free to also swing by the [Network to Code Slack](https://networktocode.slack.com/) (channel `#nautobot`), sign up [here](http://slack.networktocode.com/) if you don't have an account.
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile b/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile
index d2f096d0..e4851f92 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile
@@ -6,8 +6,8 @@
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW
-# Accepts a desired Nautobot version as build argument, default to {{cookiecutter.min_nautobot_version}}
-ARG NAUTOBOT_VER="{{cookiecutter.min_nautobot_version}}"
+# Accepts a desired Nautobot version as build argument, default to {{ cookiecutter.min_nautobot_version }}
+ARG NAUTOBOT_VER="{{ cookiecutter.min_nautobot_version }}"
# Accepts a desired Python version as build argument, default to 3.11
ARG PYTHON_VER="3.11"
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml
index 8ab8e986..58ce8438 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml
@@ -45,7 +45,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
depends_on:
- - "nautobot"
+ nautobot:
+ condition: "service_healthy"
healthcheck:
disable: true
<<: *nautobot-base
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml
index 7defeae5..86366357 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml
@@ -46,8 +46,6 @@ services:
volumes:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
- healthcheck:
- test: ["CMD", "true"] # Due to layering, disable: true won't work. Instead, change the test
# To expose postgres or redis to the host uncomment the following
# postgres:
# ports:
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py
index 576359ea..19f8f2a4 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py
@@ -126,12 +126,12 @@
#
# Enable installed Apps. Add the name of each App to the list.
-PLUGINS = ["{{cookiecutter.plugin_name}}"]
+PLUGINS = ["{{ cookiecutter.plugin_name }}"]
# Apps configuration settings. These settings are used by various Apps that the user may have installed.
# Each key in the dictionary is the name of an installed App and its value is a dictionary of settings.
# PLUGINS_CONFIG = {
-# '{{cookiecutter.plugin_name}}': {
+# '{{ cookiecutter.plugin_name }}': {
# 'foo': 'bar',
# 'buzz': 'bazz'
# }
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md
index 76aabdba..eb4e5277 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md
@@ -3,6 +3,6 @@
!!! warning "Developer Note - Remove Me!"
Explain how the release models of the plugin and of Nautobot work together, how releases are supported, how features and older releases are deprecated etc.
-| {{cookiecutter.verbose_name}} Version | Nautobot First Support Version | Nautobot Last Support Version |
+| {{ cookiecutter.verbose_name }} Version | Nautobot First Support Version | Nautobot Last Support Version |
| ------------- | -------------------- | ------------- |
-| 1.0.X | {{cookiecutter.min_nautobot_version}} | 1.99.99 |
+| 1.0.X | {{ cookiecutter.min_nautobot_version }} | 2.99.99 |
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md
index 409f77fd..c1a11fb7 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md
@@ -7,7 +7,7 @@ Here you will find detailed instructions on how to **install** and **configure**
## Prerequisites
-- The plugin is compatible with Nautobot {{cookiecutter.min_nautobot_version}} and higher.
+- The plugin is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher.
- Databases supported: PostgreSQL, MySQL
!!! note
@@ -21,31 +21,31 @@ Here you will find detailed instructions on how to **install** and **configure**
## Install Guide
!!! note
- Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{cookiecutter.plugin_slug}}`](https://pypi.org/project/{{cookiecutter.plugin_slug}}/).
+ Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{ cookiecutter.plugin_slug }}`](https://pypi.org/project/{{ cookiecutter.plugin_slug }}/).
The plugin is available as a Python package via PyPI and can be installed with `pip`:
```shell
-pip install {{cookiecutter.plugin_slug}}
+pip install {{ cookiecutter.plugin_slug }}
```
-To ensure {{cookiecutter.verbose_name}} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{cookiecutter.plugin_slug}}` package:
+To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.plugin_slug }}` package:
```shell
-echo {{cookiecutter.plugin_slug}} >> local_requirements.txt
+echo {{ cookiecutter.plugin_slug }} >> local_requirements.txt
```
Once installed, the plugin needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file:
-- Append `"{{cookiecutter.plugin_name}}"` to the `PLUGINS` list.
-- Append the `"{{cookiecutter.plugin_name}}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.
+- Append `"{{ cookiecutter.plugin_name }}"` to the `PLUGINS` list.
+- Append the `"{{ cookiecutter.plugin_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.
```python
# In your nautobot_config.py
-PLUGINS = ["{{cookiecutter.plugin_name}}"]
+PLUGINS = ["{{ cookiecutter.plugin_name }}"]
# PLUGINS_CONFIG = {
-# "{{cookiecutter.plugin_name}}": {
+# "{{ cookiecutter.plugin_name }}": {
# ADD YOUR SETTINGS HERE
# }
# }
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md
index 8abd5552..c181648b 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md
@@ -37,7 +37,7 @@ This document describes all new features and changes in the release `1.0`. The f
### Fixed
-- [#123]({{cookiecutter.repo_url}}/issues/123) Fixed Tag filtering not working in job launch form
+- [#123]({{ cookiecutter.repo_url }}/issues/123) Fixed Tag filtering not working in job launch form
## [v1.0.0] - 2021-08-03
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md
index e7381aac..72a11b50 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md
@@ -7,4 +7,4 @@ Here you will find any steps necessary to upgrade the App in your Nautobot envir
!!! warning "Developer Note - Remove Me!"
Add more detailed steps on how the app is upgraded in an existing Nautobot setup and any version specifics (such as upgrading between major versions with breaking changes).
-When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `{{cookiecutter.plugin_slug}}` package via `pip`.
+When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `{{ cookiecutter.plugin_slug }}` package via `pip`.
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md
index 81d9eaae..cf546297 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md
@@ -1,5 +1,5 @@
-# {{cookiecutter.verbose_name}} API Package
+# {{ cookiecutter.verbose_name }} API Package
-::: {{cookiecutter.plugin_name}}.api
+::: {{ cookiecutter.plugin_name }}.api
options:
show_submodules: True
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md
index bbee13e3..8c21bcdf 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md
@@ -1 +1 @@
-::: {{cookiecutter.plugin_name}}
+::: {{ cookiecutter.plugin_name }}
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md
index 04bdc234..b48467d5 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md
@@ -13,14 +13,14 @@ This is a quick reference guide if you're already familiar with the development
The [Invoke](http://www.pyinvoke.org/) library is used to provide some helper commands based on the environment. There are a few configuration parameters which can be passed to Invoke to override the default configuration:
-- `nautobot_ver`: the version of Nautobot to use as a base for any built docker containers (default: {{cookiecutter.min_nautobot_version}})
-- `project_name`: the default docker compose project name (default: `{{cookiecutter.plugin_slug}}`)
+- `nautobot_ver`: the version of Nautobot to use as a base for any built docker containers (default: {{ cookiecutter.min_nautobot_version }})
+- `project_name`: the default docker compose project name (default: `{{ cookiecutter.plugin_slug }}`)
- `python_ver`: the version of Python to use as a base for any built docker containers (default: 3.11)
- `local`: a boolean flag indicating if invoke tasks should be run on the host or inside the docker containers (default: False, commands will be run in docker containers)
- `compose_dir`: the full path to a directory containing the project compose files
- `compose_files`: a list of compose files applied in order (see [Multiple Compose files](https://docs.docker.com/compose/extends/#multiple-compose-files) for more information)
-Using **Invoke** these configuration options can be overridden using [several methods](https://docs.pyinvoke.org/en/stable/concepts/configuration.html). Perhaps the simplest is setting an environment variable `INVOKE_{{cookiecutter.plugin_name.upper()}}_VARIABLE_NAME` where `VARIABLE_NAME` is the variable you are trying to override. The only exception is `compose_files`, because it is a list it must be overridden in a YAML file. There is an example `invoke.yml` (`invoke.example.yml`) in this directory which can be used as a starting point.
+Using **Invoke** these configuration options can be overridden using [several methods](https://docs.pyinvoke.org/en/stable/concepts/configuration.html). Perhaps the simplest is setting an environment variable `INVOKE_{{ cookiecutter.plugin_name.upper() }}_VARIABLE_NAME` where `VARIABLE_NAME` is the variable you are trying to override. The only exception is `compose_files`, because it is a list it must be overridden in a YAML file. There is an example `invoke.yml` (`invoke.example.yml`) in this directory which can be used as a starting point.
### Docker Development Environment
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png b/nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png
similarity index 100%
rename from nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{cookiecutter.plugin_slug}}.png
rename to nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml
index 2ca5e5b9..d76d1632 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml
@@ -1,7 +1,7 @@
---
-{{cookiecutter.plugin_name}}:
- project_name: "{{cookiecutter.plugin_slug}}"
- nautobot_ver: "{{cookiecutter.min_nautobot_version}}"
+{{ cookiecutter.plugin_name }}:
+ project_name: "{{ cookiecutter.plugin_slug }}"
+ nautobot_ver: "{{ cookiecutter.min_nautobot_version }}"
local: false
python_ver: "3.11"
compose_dir: "development"
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml
index 35e26101..e0e248ff 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml
@@ -1,7 +1,7 @@
---
-{{cookiecutter.plugin_name}}:
- project_name: "{{cookiecutter.plugin_slug}}"
- nautobot_ver: "{{cookiecutter.min_nautobot_version}}"
+{{ cookiecutter.plugin_name }}:
+ project_name: "{{ cookiecutter.plugin_slug }}"
+ nautobot_ver: "{{ cookiecutter.min_nautobot_version }}"
local: false
python_ver: "3.11"
compose_dir: "development"
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml b/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml
index 9696cc77..e42aa68b 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml
@@ -1,10 +1,10 @@
---
dev_addr: "127.0.0.1:8001"
-edit_uri: "edit/main/{{cookiecutter.project_slug}}/docs"
-site_dir: "{{cookiecutter.plugin_name}}/static/{{cookiecutter.plugin_name}}/docs"
-site_name: "{{cookiecutter.verbose_name}} Documentation"
-site_url: "{{cookiecutter.docs_app_url}}/"
-repo_url: "{{cookiecutter.repo_url}}"
+edit_uri: "edit/main/{{ cookiecutter.project_slug }}/docs"
+site_dir: "{{ cookiecutter.plugin_name }}/static/{{ cookiecutter.plugin_name }}/docs"
+site_name: "{{ cookiecutter.verbose_name }} Documentation"
+site_url: "{{ cookiecutter.docs_app_url }}/"
+repo_url: "{{ cookiecutter.repo_url }}"
copyright: "Copyright © The Authors"
theme:
name: "material"
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml b/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml
index f542d4db..7804ada0 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml
@@ -1,14 +1,14 @@
[tool.poetry]
-name = "{{cookiecutter.plugin_slug}}"
+name = "{{ cookiecutter.plugin_slug }}"
version = "0.1.0"
-description = "{{cookiecutter.project_short_description}}"
-authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"]
+description = "{{ cookiecutter.project_short_description }}"
+authors = ["{{ cookiecutter.full_name }} <{{ cookiecutter.email }}>"]
{%- if cookiecutter.open_source_license == 'Apache-2.0' %}
-license = "{{cookiecutter.open_source_license}}"
+license = "{{ cookiecutter.open_source_license }}"
{%- endif %}
readme = "README.md"
-homepage = "{{cookiecutter.repo_url}}"
-repository = "{{cookiecutter.repo_url}}"
+homepage = "{{ cookiecutter.repo_url }}"
+repository = "{{ cookiecutter.repo_url }}"
keywords = ["nautobot", "nautobot-plugin"]
classifiers = [
"Intended Audience :: Developers",
@@ -26,13 +26,13 @@ include = [
"README.md",
]
packages = [
- { include = "{{cookiecutter.plugin_name}}" },
+ { include = "{{ cookiecutter.plugin_name }}" },
]
[tool.poetry.dependencies]
python = ">=3.8,<3.12"
# Used for local development
-nautobot = "^{{cookiecutter.min_nautobot_version}}"
+nautobot = "^{{ cookiecutter.min_nautobot_version }}"
[tool.poetry.group.dev.dependencies]
bandit = "*"
@@ -111,7 +111,7 @@ notes = """,
[tool.pylint-nautobot]
supported_nautobot_versions = [
- "{{cookiecutter.min_nautobot_version}}"
+ "{{ cookiecutter.min_nautobot_version }}"
]
[tool.pydocstyle]
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py b/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py
index 526df2d4..a0a7d9fe 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py
@@ -43,13 +43,13 @@ def is_truthy(arg):
# Use pyinvoke configuration for default values, see http://docs.pyinvoke.org/en/stable/concepts/configuration.html
-# Variables may be overwritten in invoke.yml or by the environment variables INVOKE_{{cookiecutter.plugin_name.upper()}}_xxx
-namespace = Collection("{{cookiecutter.plugin_name}}")
+# Variables may be overwritten in invoke.yml or by the environment variables INVOKE_{{ cookiecutter.plugin_name.upper() }}_xxx
+namespace = Collection("{{ cookiecutter.plugin_name }}")
namespace.configure(
{
- "{{cookiecutter.plugin_name}}": {
- "nautobot_ver": "{{cookiecutter.min_nautobot_version}}",
- "project_name": "{{cookiecutter.plugin_slug}}",
+ "{{ cookiecutter.plugin_name }}": {
+ "nautobot_ver": "{{ cookiecutter.min_nautobot_version }}",
+ "project_name": "{{ cookiecutter.plugin_slug }}",
"python_ver": "3.11",
"local": False,
"compose_dir": os.path.join(os.path.dirname(__file__), "development"),
@@ -66,7 +66,7 @@ def is_truthy(arg):
def _is_compose_included(context, name):
- return f"docker-compose.{name}.yml" in context.{{cookiecutter.plugin_name}}.compose_files
+ return f"docker-compose.{name}.yml" in context.{{ cookiecutter.plugin_name }}.compose_files
def _await_healthy_service(context, service):
@@ -118,19 +118,19 @@ def docker_compose(context, command, **kwargs):
build_env = {
# Note: 'docker compose logs' will stop following after 60 seconds by default,
# so we are overriding that by setting this environment variable.
- "COMPOSE_HTTP_TIMEOUT": context.{{cookiecutter.plugin_name}}.compose_http_timeout,
- "NAUTOBOT_VER": context.{{cookiecutter.plugin_name}}.nautobot_ver,
- "PYTHON_VER": context.{{cookiecutter.plugin_name}}.python_ver,
+ "COMPOSE_HTTP_TIMEOUT": context.{{ cookiecutter.plugin_name }}.compose_http_timeout,
+ "NAUTOBOT_VER": context.{{ cookiecutter.plugin_name }}.nautobot_ver,
+ "PYTHON_VER": context.{{ cookiecutter.plugin_name }}.python_ver,
**kwargs.pop("env", {}),
}
compose_command_tokens = [
"docker compose",
- f"--project-name {context.{{cookiecutter.plugin_name}}.project_name}",
- f'--project-directory "{context.{{cookiecutter.plugin_name}}.compose_dir}"',
+ f"--project-name {context.{{ cookiecutter.plugin_name }}.project_name}",
+ f'--project-directory "{context.{{ cookiecutter.plugin_name }}.compose_dir}"',
]
- for compose_file in context.{{cookiecutter.plugin_name}}.compose_files:
- compose_file_path = os.path.join(context.{{cookiecutter.plugin_name}}.compose_dir, compose_file)
+ for compose_file in context.{{ cookiecutter.plugin_name }}.compose_files:
+ compose_file_path = os.path.join(context.{{ cookiecutter.plugin_name }}.compose_dir, compose_file)
compose_command_tokens.append(f' -f "{compose_file_path}"')
compose_command_tokens.append(command)
@@ -148,7 +148,7 @@ def docker_compose(context, command, **kwargs):
def run_command(context, command, **kwargs):
"""Wrapper to run a command locally or inside the nautobot container."""
- if is_truthy(context.{{cookiecutter.plugin_name}}.local):
+ if is_truthy(context.{{ cookiecutter.plugin_name }}.local):
context.run(command, **kwargs)
else:
# Check if nautobot is running, no need to start another nautobot container to run a command
@@ -182,7 +182,7 @@ def build(context, force_rm=False, cache=True):
if force_rm:
command += " --force-rm"
- print(f"Building Nautobot with Python {context.{{cookiecutter.plugin_name}}.python_ver}...")
+ print(f"Building Nautobot with Python {context.{{ cookiecutter.plugin_name }}.python_ver}...")
docker_compose(context, command)
@@ -370,7 +370,7 @@ def createsuperuser(context, user="admin"):
)
def makemigrations(context, name=""):
"""Perform makemigrations operation in Django."""
- command = "nautobot-server makemigrations {{cookiecutter.plugin_name}}"
+ command = "nautobot-server makemigrations {{ cookiecutter.plugin_name }}"
if name:
command += f" --name {name}"
@@ -586,7 +586,7 @@ def docs(context):
"""Build and serve docs locally for development."""
command = "mkdocs serve -v"
- if is_truthy(context.{{cookiecutter.plugin_name}}.local):
+ if is_truthy(context.{{ cookiecutter.plugin_name }}.local):
print(">>> Serving Documentation at http://localhost:8001")
run_command(context, command)
else:
@@ -649,7 +649,7 @@ def hadolint(context):
@task
def pylint(context):
"""Run pylint code analysis."""
- command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml {{cookiecutter.plugin_name}}'
+ command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml {{ cookiecutter.plugin_name }}'
run_command(context, command)
@@ -700,7 +700,7 @@ def check_migrations(context):
def unittest(
context,
keepdb=False,
- label="{{cookiecutter.plugin_name}}",
+ label="{{ cookiecutter.plugin_name }}",
failfast=False,
buffer=True,
pattern="",
@@ -726,7 +726,7 @@ def unittest(
@task
def unittest_coverage(context):
"""Report on code test coverage as measured by 'invoke unittest'."""
- command = "coverage report --skip-covered --include '{{cookiecutter.plugin_name}}/*' --omit *migrations*"
+ command = "coverage report --skip-covered --include '{{ cookiecutter.plugin_name }}/*' --omit *migrations*"
run_command(context, command)
@@ -741,7 +741,7 @@ def unittest_coverage(context):
def tests(context, failfast=False, keepdb=False, lint_only=False):
"""Run all tests for this plugin."""
# If we are not running locally, start the docker containers so we don't have to for each test
- if not is_truthy(context.{{cookiecutter.plugin_name}}.local):
+ if not is_truthy(context.{{ cookiecutter.plugin_name }}.local):
print("Starting Docker Containers...")
start(context)
# Sorted loosely from fastest to slowest
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py
new file mode 100644
index 00000000..dbf1b429
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py
@@ -0,0 +1,26 @@
+"""Plugin declaration for {{ cookiecutter.plugin_name }}."""
+# Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added
+from importlib import metadata
+
+from nautobot.apps import NautobotAppConfig
+
+__version__ = metadata.version(__name__)
+
+
+class {{ cookiecutter.camel_name }}Config(NautobotAppConfig):
+ """Plugin configuration for the {{ cookiecutter.plugin_name }} plugin."""
+
+ name = "{{ cookiecutter.plugin_name }}"
+ verbose_name = "{{ cookiecutter.verbose_name }}"
+ version = __version__
+ author = "{{ cookiecutter.full_name }}"
+ description = "{{ cookiecutter.project_short_description }}."
+ base_url = "{{ cookiecutter.base_url }}"
+ required_settings = []
+ min_version = "{{ cookiecutter.min_nautobot_version }}"
+ max_version = "{{ cookiecutter.max_nautobot_version }}"
+ default_settings = {}
+ caching_config = {}
+
+
+config = {{ cookiecutter.camel_name }}Config # pylint:disable=invalid-name
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py
new file mode 100644
index 00000000..f3ae94ec
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py
@@ -0,0 +1 @@
+"""REST API module for {{ cookiecutter.plugin_name }} plugin."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py
new file mode 100644
index 00000000..b3585cce
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py
@@ -0,0 +1,17 @@
+"""API serializers for {{ cookiecutter.plugin_name }}."""
+from nautobot.apps.api import NautobotModelSerializer, TaggedModelSerializerMixin
+
+from {{ cookiecutter.plugin_name }} import models
+
+
+class {{ cookiecutter.model_class_name }}Serializer(NautobotModelSerializer, TaggedModelSerializerMixin): # pylint: disable=too-many-ancestors
+ """{{ cookiecutter.model_class_name }} Serializer."""
+
+ class Meta:
+ """Meta attributes."""
+
+ model = models.{{ cookiecutter.model_class_name }}
+ fields = "__all__"
+
+ # Option for disabling write for certain fields:
+ # read_only_fields = []
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
similarity index 80%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
index 3c956234..fbda22a7 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/urls.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py
@@ -1,6 +1,6 @@
"""Django API urlpatterns declaration for {{ cookiecutter.plugin_name }} plugin."""
-from nautobot.core.api import OrderedDefaultRouter
+from nautobot.apps.api import OrderedDefaultRouter
from {{ cookiecutter.plugin_name }}.api import views
@@ -8,6 +8,4 @@
# add the name of your api endpoint, usually hyphenated model name in plural, e.g. "my-model-classes"
router.register("{{ cookiecutter.model_class_name.lower() }}", views.{{ cookiecutter.model_class_name }}ViewSet)
-
-app_name = "{{ cookiecutter.plugin_name }}-api"
urlpatterns = router.urls
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
similarity index 71%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
index 67c9f920..846c45dc 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/views.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py
@@ -1,13 +1,12 @@
"""API views for {{ cookiecutter.plugin_name }}."""
-from nautobot.core.api.views import ModelViewSet
-
-from {{cookiecutter.plugin_name }} import filters, models
+from nautobot.apps.api import NautobotModelViewSet
+from {{ cookiecutter.plugin_name }} import filters, models
from {{ cookiecutter.plugin_name }}.api import serializers
-class {{ cookiecutter.model_class_name }}ViewSet(ModelViewSet): # pylint: disable=too-many-ancestors
+class {{ cookiecutter.model_class_name }}ViewSet(NautobotModelViewSet): # pylint: disable=too-many-ancestors
"""{{ cookiecutter.model_class_name }} viewset."""
queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
similarity index 60%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
index 0f210a98..1445143f 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/filters.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py
@@ -1,11 +1,11 @@
"""Filtering for {{ cookiecutter.plugin_name }}."""
-from nautobot.utilities.filters import BaseFilterSet, NameSlugSearchFilterSet
+from nautobot.apps.filters import NautobotFilterSet, NameSearchFilterSet
from {{ cookiecutter.plugin_name }} import models
-class {{ cookiecutter.model_class_name }}FilterSet(BaseFilterSet, NameSlugSearchFilterSet):
+class {{ cookiecutter.model_class_name }}FilterSet(NautobotFilterSet, NameSearchFilterSet): # pylint: disable=too-many-ancestors
"""Filter for {{ cookiecutter.model_class_name }}."""
class Meta:
@@ -14,4 +14,4 @@ class Meta:
model = models.{{ cookiecutter.model_class_name }}
# add any fields from the model that you would like to filter your searches by using those
- fields = ["id", "name", "slug", "description"]
+ fields = ["id", "name", "description"]
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
similarity index 57%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
index 60208679..f74cb470 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/forms.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py
@@ -1,31 +1,24 @@
"""Forms for {{ cookiecutter.plugin_name }}."""
from django import forms
-from nautobot.utilities.forms import (
- BootstrapMixin,
- BulkEditForm,
- SlugField,
-)
+from nautobot.apps.forms import NautobotBulkEditForm, NautobotFilterForm, NautobotModelForm, TagsBulkEditFormMixin
from {{ cookiecutter.plugin_name }} import models
-class {{ cookiecutter.model_class_name }}Form(BootstrapMixin, forms.ModelForm):
+class {{ cookiecutter.model_class_name }}Form(NautobotModelForm): # pylint: disable=too-many-ancestors
"""{{ cookiecutter.model_class_name }} creation/edit form."""
- slug = SlugField()
-
class Meta:
"""Meta attributes."""
model = models.{{ cookiecutter.model_class_name }}
fields = [
"name",
- "slug",
"description",
]
-class {{ cookiecutter.model_class_name }}BulkEditForm(BootstrapMixin, BulkEditForm):
+class {{ cookiecutter.model_class_name }}BulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm): # pylint: disable=too-many-ancestors
"""{{ cookiecutter.model_class_name }} bulk edit form."""
pk = forms.ModelMultipleChoiceField(queryset=models.{{ cookiecutter.model_class_name }}.objects.all(), widget=forms.MultipleHiddenInput)
@@ -39,25 +32,15 @@ class Meta:
]
-class {{ cookiecutter.model_class_name }}FilterForm(BootstrapMixin, forms.ModelForm):
+class {{ cookiecutter.model_class_name }}FilterForm(NautobotFilterForm):
"""Filter form to filter searches."""
+ model = models.{{ cookiecutter.model_class_name }}
+ field_order = ["q", "name"]
+
q = forms.CharField(
required=False,
label="Search",
help_text="Search within Name or Slug.",
)
name = forms.CharField(required=False, label="Name")
- slug = forms.CharField(required=False, label="Slug")
-
- class Meta:
- """Meta attributes."""
-
- model = models.{{ cookiecutter.model_class_name }}
- # Define the fields above for ordering and widget purposes
- fields = [
- "q",
- "name",
- "slug",
- "description",
- ]
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py
similarity index 100%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/migrations/__init__.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
similarity index 74%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
index 0cdad60a..d8798660 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/models.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py
@@ -2,11 +2,9 @@
# Django imports
from django.db import models
-from django.urls import reverse
# Nautobot imports
-from nautobot.core.models import BaseModel
-from nautobot.extras.models.change_logging import ChangeLoggedModel
+from nautobot.apps.models import PrimaryModel
# from nautobot.extras.utils import extras_features
@@ -15,13 +13,13 @@
# Then based on your reading you may decide to put the following decorator before the declaration of your class
# @extras_features("custom_fields", "custom_validators", "relationships", "graphql")
+
# If you want to choose a specific model to overload in your class declaration, please reference the following documentation:
# how to chose a database model: https://docs.nautobot.com/projects/core/en/stable/plugins/development/#database-models
-class {{ cookiecutter.model_class_name }}(BaseModel, ChangeLoggedModel):
+class {{ cookiecutter.model_class_name }}(PrimaryModel): # pylint: disable=too-many-ancestors
"""Base model for {{ cookiecutter.verbose_name }} plugin."""
name = models.CharField(max_length=100, unique=True)
- slug = models.SlugField(max_length=100, unique=True)
description = models.CharField(max_length=200, blank=True)
# additional model fields
@@ -36,10 +34,6 @@ class Meta:
# Option for fixing plural name (i.e. "Chicken Tenders" vs "Chicken Tendies")
# verbose_name_plural = "{{ cookiecutter.verbose_name }}s"
- def get_absolute_url(self):
- """Return detail view for {{ cookiecutter.model_class_name }}."""
- return reverse("plugins:{{ cookiecutter.plugin_name }}:{{ cookiecutter.model_class_name.lower() }}", args=[self.slug])
-
def __str__(self):
"""Stringify instance."""
return self.name
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
similarity index 59%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
index 6e3ef3cd..51291170 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/navigation.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py
@@ -1,21 +1,25 @@
"""Menu items."""
-from nautobot.extras.plugins import PluginMenuButton, PluginMenuItem
-from nautobot.utilities.choices import ButtonColorChoices
+from nautobot.apps.ui import NavMenuAddButton, NavMenuGroup, NavMenuItem, NavMenuTab
-menu_items = (
- PluginMenuItem(
+
+items = (
+ NavMenuItem(
link="plugins:{{ cookiecutter.plugin_name }}:{{ cookiecutter.model_class_name.lower() }}_list",
- link_text="{{ cookiecutter.verbose_name }}",
+ name="{{ cookiecutter.verbose_name }}",
permissions=["{{ cookiecutter.plugin_name }}.view_{{ cookiecutter.model_class_name.lower() }}"],
buttons=(
- PluginMenuButton(
+ NavMenuAddButton(
link="plugins:{{ cookiecutter.plugin_name }}:{{ cookiecutter.model_class_name.lower() }}_add",
- title="Add",
- icon_class="mdi mdi-plus-thick",
- color=ButtonColorChoices.GREEN,
permissions=["{{ cookiecutter.plugin_name }}.add_{{ cookiecutter.model_class_name.lower() }}"],
),
),
),
)
+
+menu_items = (
+ NavMenuTab(
+ name="Plugins",
+ groups=(NavMenuGroup(name="{{ cookiecutter.verbose_name }}", items=tuple(items)),),
+ ),
+)
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
similarity index 90%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
index 1d73474c..f99cf0b0 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tables.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py
@@ -1,7 +1,7 @@
"""Tables for {{ cookiecutter.plugin_name }}."""
import django_tables2 as tables
-from nautobot.utilities.tables import BaseTable, ButtonsColumn, ToggleColumn
+from nautobot.apps.tables import BaseTable, ButtonsColumn, ToggleColumn
from {{ cookiecutter.plugin_name }} import models
@@ -17,7 +17,7 @@ class {{ cookiecutter.model_class_name }}Table(BaseTable):
# Option for modifying the default action buttons on each row:
# buttons=("changelog", "edit", "delete"),
# Option for modifying the pk for the action buttons:
- pk_field="slug",
+ pk_field="pk",
)
class Meta(BaseTable.Meta):
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html
new file mode 100644
index 00000000..66cc5ad0
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html
@@ -0,0 +1,26 @@
+{% raw %}
+{% extends 'generic/object_retrieve.html' %}
+{% load helpers %}
+
+{% block content_left_page %}
+
+
+ {% endraw %}{{ cookiecutter.model_class_name }}{% raw %}
+
+
+
+ Name |
+
+ {{ object.name }}
+ |
+
+
+ Description |
+
+ {{ object.description|placeholder }}
+ |
+
+
+
+{% endblock %}
+{% endraw %}
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py
new file mode 100644
index 00000000..24374daf
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py
@@ -0,0 +1 @@
+"""Unit tests for {{ cookiecutter.plugin_name }} plugin."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
similarity index 85%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
index 4e852a21..1bff1dfe 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/fixtures.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py
@@ -4,6 +4,6 @@
def create_{{ cookiecutter.model_class_name.lower() }}():
"""Fixture to create necessary number of {{ cookiecutter.model_class_name }} for tests."""
- {{ cookiecutter.model_class_name }}.objects.create(name="Test One", slug="test-one")
- {{ cookiecutter.model_class_name }}.objects.create(name="Test Two", slug="test-two")
- {{ cookiecutter.model_class_name }}.objects.create(name="Test Three", slug="test-three")
+ {{ cookiecutter.model_class_name }}.objects.create(name="Test One")
+ {{ cookiecutter.model_class_name }}.objects.create(name="Test Two")
+ {{ cookiecutter.model_class_name }}.objects.create(name="Test Three")
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
similarity index 89%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
index 82510445..deb81593 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py
@@ -1,4 +1,4 @@
-"""Unit tests for {{cookiecutter.plugin_name}}."""
+"""Unit tests for {{ cookiecutter.plugin_name }}."""
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
@@ -11,7 +11,7 @@
class PlaceholderAPITest(TestCase):
- """Test the {{cookiecutter.camel_name}} API."""
+ """Test the {{ cookiecutter.camel_name }} API."""
def setUp(self):
"""Create a superuser and token for API calls."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
similarity index 70%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
index 413419aa..a6c0bfab 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_api_views.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py
@@ -1,5 +1,5 @@
-"""Unit tests for {{cookiecutter.plugin_name}}."""
-from nautobot.utilities.testing import APIViewTestCases
+"""Unit tests for {{ cookiecutter.plugin_name }}."""
+from nautobot.apps.testing import APIViewTestCases
from {{ cookiecutter.plugin_name }} import models
from {{ cookiecutter.plugin_name }}.tests import fixtures
@@ -13,15 +13,13 @@ class {{ cookiecutter.model_class_name }}APIViewTest(APIViewTestCases.APIViewTes
create_data = [
{
"name": "Test Model 1",
- "slug": "test-model-1",
+ "description": "test description",
},
{
"name": "Test Model 2",
- "slug": "test-model-2",
},
]
bulk_update_data = {"description": "Test Bulk Update"}
- brief_fields = ["created", "description", "display", "id", "last_updated", "name", "slug", "url"]
@classmethod
def setUpTestData(cls):
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py
similarity index 100%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_basic.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
similarity index 83%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
index c53fa7dc..51ae405c 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py
@@ -21,11 +21,6 @@ def test_q_search_name(self):
params = {"q": "Test One"}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)
- def test_q_search_slug(self):
- """Test using Q search with slug of {{ cookiecutter.model_class_name }}."""
- params = {"q": "test-one"}
- self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)
-
def test_q_invalid(self):
"""Test using invalid Q search for {{ cookiecutter.model_class_name }}."""
params = {"q": "test-five"}
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
similarity index 76%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
index d6a4ca82..d1669d83 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py
@@ -11,7 +11,6 @@ def test_specifying_all_fields_success(self):
form = forms.{{ cookiecutter.model_class_name }}Form(
data={
"name": "Development",
- "slug": "development",
"description": "Development Testing",
}
)
@@ -22,18 +21,12 @@ def test_specifying_only_required_success(self):
form = forms.{{ cookiecutter.model_class_name }}Form(
data={
"name": "Development",
- "slug": "development",
}
)
self.assertTrue(form.is_valid())
self.assertTrue(form.save())
def test_validate_name_{{ cookiecutter.model_class_name.lower() }}_is_required(self):
- form = forms.{{ cookiecutter.model_class_name }}Form(data={"slug": "development"})
+ form = forms.{{ cookiecutter.model_class_name }}Form(data={"description": "Development Testing"})
self.assertFalse(form.is_valid())
self.assertIn("This field is required.", form.errors["name"])
-
- def test_validate_slug_is_required(self):
- form = forms.{{ cookiecutter.model_class_name }}Form(data={"name": "Development"})
- self.assertFalse(form.is_valid())
- self.assertIn("This field is required.", form.errors["slug"])
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
similarity index 78%
rename from nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
index b73b3238..37ba789a 100644
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py
@@ -10,17 +10,13 @@ class Test{{ cookiecutter.model_class_name }}(TestCase):
def test_create_{{ cookiecutter.model_class_name.lower() }}_only_required(self):
"""Create with only required fields, and validate null description and __str__."""
- {{ cookiecutter.model_class_name.lower() }} = models.{{ cookiecutter.model_class_name }}.objects.create(name="Development", slug="development")
+ {{ cookiecutter.model_class_name.lower() }} = models.{{ cookiecutter.model_class_name }}.objects.create(name="Development")
self.assertEqual({{ cookiecutter.model_class_name.lower() }}.name, "Development")
self.assertEqual({{ cookiecutter.model_class_name.lower() }}.description, "")
self.assertEqual(str({{ cookiecutter.model_class_name.lower() }}), "Development")
- self.assertEqual({{ cookiecutter.model_class_name.lower() }}.slug, "development")
def test_create_{{ cookiecutter.model_class_name.lower() }}_all_fields_success(self):
"""Create {{ cookiecutter.model_class_name }} with all fields."""
- {{ cookiecutter.model_class_name.lower() }} = models.{{ cookiecutter.model_class_name }}.objects.create(
- name="Development", slug="development", description="Development Test"
- )
+ {{ cookiecutter.model_class_name.lower() }} = models.{{ cookiecutter.model_class_name }}.objects.create(name="Development", description="Development Test")
self.assertEqual({{ cookiecutter.model_class_name.lower() }}.name, "Development")
- self.assertEqual({{ cookiecutter.model_class_name.lower() }}.slug, "development")
self.assertEqual({{ cookiecutter.model_class_name.lower() }}.description, "Development Test")
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py
new file mode 100644
index 00000000..6c7252b2
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py
@@ -0,0 +1,27 @@
+"""Unit tests for views."""
+from nautobot.apps.testing import ViewTestCases
+
+from {{ cookiecutter.plugin_name }} import models
+from {{ cookiecutter.plugin_name }}.tests import fixtures
+
+
+class {{ cookiecutter.model_class_name }}ViewTest(ViewTestCases.PrimaryObjectViewTestCase):
+ # pylint: disable=too-many-ancestors
+ """Test the {{ cookiecutter.model_class_name }} views."""
+
+ model = models.{{ cookiecutter.model_class_name }}
+ bulk_edit_data = {"description": "Bulk edit views"}
+ form_data = {
+ "name": "Test 1",
+ "description": "Initial model",
+ }
+ csv_data = (
+ "name",
+ "Test csv1",
+ "Test csv2",
+ "Test csv3",
+ )
+
+ @classmethod
+ def setUpTestData(cls):
+ fixtures.create_{{ cookiecutter.model_class_name.lower() }}()
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py
new file mode 100644
index 00000000..d6a26306
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py
@@ -0,0 +1,10 @@
+"""Django urlpatterns declaration for {{ cookiecutter.plugin_name }} plugin."""
+from nautobot.apps.urls import NautobotUIViewSetRouter
+
+from {{ cookiecutter.plugin_name }} import views
+
+
+router = NautobotUIViewSetRouter()
+router.register("{{ cookiecutter.model_class_name | lower }}", views.{{ cookiecutter.model_class_name }}UIViewSet)
+
+urlpatterns = router.urls
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py
new file mode 100644
index 00000000..9ac7370a
--- /dev/null
+++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py
@@ -0,0 +1,18 @@
+"""Views for {{ cookiecutter.plugin_name }}."""
+from nautobot.apps.views import NautobotUIViewSet
+
+from {{ cookiecutter.plugin_name }} import filters, forms, models, tables
+from {{ cookiecutter.plugin_name }}.api import serializers
+
+
+class {{ cookiecutter.model_class_name }}UIViewSet(NautobotUIViewSet):
+ """ViewSet for {{ cookiecutter.model_class_name }} views."""
+
+ bulk_update_form_class = forms.{{ cookiecutter.model_class_name }}BulkEditForm
+ filterset_class = filters.{{ cookiecutter.model_class_name }}FilterSet
+ filterset_form_class = forms.{{ cookiecutter.model_class_name }}FilterForm
+ form_class = forms.{{ cookiecutter.model_class_name }}Form
+ lookup_field = "pk"
+ queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
+ serializer_class = serializers.{{ cookiecutter.model_class_name }}Serializer
+ table_class = tables.{{ cookiecutter.model_class_name }}Table
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py
deleted file mode 100644
index e7018530..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-"""Plugin declaration for {{cookiecutter.plugin_name}}."""
-from importlib import metadata
-
-from nautobot.extras.plugins import NautobotAppConfig
-
-__version__ = metadata.version(__name__)
-
-
-class {{cookiecutter.camel_name}}Config(NautobotAppConfig):
- """Plugin configuration for the {{cookiecutter.plugin_name}} plugin."""
-
- name = "{{cookiecutter.plugin_name}}"
- verbose_name = "{{cookiecutter.verbose_name}}"
- version = __version__
- author = "{{cookiecutter.full_name}}"
- description = "{{cookiecutter.project_short_description}}."
- base_url = "{{cookiecutter.base_url}}"
- required_settings = []
- min_version = "{{cookiecutter.min_nautobot_version}}"
- max_version = "{{cookiecutter.max_nautobot_version}}"
- default_settings = {}
- caching_config = {}
-
-
-config = {{cookiecutter.camel_name}}Config # pylint:disable=invalid-name
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py
deleted file mode 100644
index 85ab6d45..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-"""REST API module for {{cookiecutter.plugin_name}} plugin."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py
deleted file mode 100644
index 198c4937..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/nested_serializers.py
+++ /dev/null
@@ -1,18 +0,0 @@
-"""API nested serializers for {{ cookiecutter.plugin_name }}."""
-from rest_framework import serializers
-
-from nautobot.core.api import WritableNestedSerializer
-
-from {{ cookiecutter.plugin_name }} import models
-
-
-class {{ cookiecutter.model_class_name }}NestedSerializer(WritableNestedSerializer):
- """{{ cookiecutter.model_class_name }} Nested Serializer."""
-
- url = serializers.HyperlinkedIdentityField(view_name="plugins-api:{{ cookiecutter.plugin_name }}-api:{{ cookiecutter.model_class_name | lower }}-detail")
-
- class Meta:
- """Meta attributes."""
-
- model = models.{{ cookiecutter.model_class_name }}
- fields = "__all__"
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py
deleted file mode 100644
index 1c29b462..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/api/serializers.py
+++ /dev/null
@@ -1,23 +0,0 @@
-"""API serializers for {{ cookiecutter.plugin_name }}."""
-from rest_framework import serializers
-
-from nautobot.core.api.serializers import ValidatedModelSerializer
-
-from {{ cookiecutter.plugin_name }} import models
-
-from . import nested_serializers # noqa: F401, pylint: disable=unused-import
-
-
-class {{ cookiecutter.model_class_name }}Serializer(ValidatedModelSerializer):
- """{{ cookiecutter.model_class_name }} Serializer."""
-
- url = serializers.HyperlinkedIdentityField(view_name="plugins-api:{{ cookiecutter.plugin_name }}-api:{{ cookiecutter.model_class_name | lower }}-detail")
-
- class Meta:
- """Meta attributes."""
-
- model = models.{{ cookiecutter.model_class_name }}
- fields = "__all__"
-
- # Option for disabling write for certain fields:
- # read_only_fields = []
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html
deleted file mode 100644
index 63f0a66f..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/templates/{{cookiecutter.plugin_name}}/{{cookiecutter.model_class_name | lower }}.html
+++ /dev/null
@@ -1,101 +0,0 @@
-{% raw %}
-{% extends 'generic/object_retrieve.html' %}
-{% load buttons %}
-{% load static %}
-{% load custom_links %}
-{% load helpers %}
-{% load plugins %}
-
-{% block title %}{{ object }}{% endblock %}
-{% endraw %}
-
-{% raw %}
-{% block header %}
-
-
- {% if perms.{% endraw %}{{ cookiecutter.plugin_name }}.change_{{ cookiecutter.model_class_name.lower() }}{% raw %} %}
-
- Edit
-
- {% endif %}
- {% if perms.{% endraw %}{{ cookiecutter.plugin_name }}.delete_{{ cookiecutter.model_class_name.lower() }}{% raw %} %}
-
- Delete
-
- {% endif %}
-
-{{ object }}
-{% include 'inc/created_updated.html' with obj=object %}
-
- {% custom_links object %}
-
-
-{% endblock %}
-
-{% block content %}
-
-
-
-
- {% endraw %}{{ cookiecutter.model_class_name }}{% raw %}
-
-
-
- Name |
-
- {{ object.name }}
- |
-
-
- Description |
-
- {{ object.description|placeholder }}
- |
-
-
-
- {% include 'inc/custom_fields_panel.html' %}
- {% include 'inc/relationships_panel.html' %}
- {% plugin_left_page object %}
-
-
-
-
- {% plugin_full_width_page object %}
-
-
-{% endblock %}
-{% endraw %}
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py
deleted file mode 100644
index 646d52af..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-"""Unit tests for {{cookiecutter.plugin_name}} plugin."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py
deleted file mode 100644
index 3b8b8d25..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/tests/test_views.py
+++ /dev/null
@@ -1,37 +0,0 @@
-"""Unit tests for views."""
-from nautobot.utilities.testing import ViewTestCases
-
-from {{ cookiecutter.plugin_name }} import models
-from {{ cookiecutter.plugin_name }}.tests import fixtures
-
-
-class {{ cookiecutter.model_class_name }}ViewTest(ViewTestCases.PrimaryObjectViewTestCase):
- # pylint: disable=too-many-ancestors
- """Test the {{ cookiecutter.model_class_name }} views."""
-
- model = models.{{ cookiecutter.model_class_name }}
- bulk_edit_data = {"description": "Bulk edit views"}
- form_data = {
- "name": "Test 1",
- "slug": "test-1",
- "description": "Initial model",
- }
-
- @classmethod
- def setUpTestData(cls):
- fixtures.create_{{ cookiecutter.model_class_name.lower() }}()
-
- def test_bulk_import_objects_with_constrained_permission(self):
- """Auto-generated model does not implement `bulk_import`."""
-
- def test_bulk_import_objects_with_permission(self):
- """Auto-generated model does not implement `bulk_import`."""
-
- def test_bulk_import_objects_without_permission(self):
- """Auto-generated model does not implement `bulk_import`."""
-
- def test_bulk_import_objects_with_permission_csv_file(self):
- """Auto-generated model does not implement `bulk_import`."""
-
- def test_has_advanced_tab(self):
- """Auto-generated model does not implement an advanced tab."""
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py
deleted file mode 100644
index 8003c0e5..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/urls.py
+++ /dev/null
@@ -1,24 +0,0 @@
-"""Django urlpatterns declaration for {{cookiecutter.plugin_name}} plugin."""
-from django.urls import path
-from nautobot.extras.views import ObjectChangeLogView
-
-from {{ cookiecutter.plugin_name }} import models
-from {{ cookiecutter.plugin_name }}.views import {{ cookiecutter.model_class_name.lower() }}
-
-urlpatterns = [
- # {{ cookiecutter.model_class_name }} URLs
- path("{{ cookiecutter.model_class_name | lower }}/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}ListView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_list"),
- # Order is important for these URLs to work (add/delete/edit) to be before any that require uuid/slug
- path("{{ cookiecutter.model_class_name | lower }}/add/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}CreateView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_add"),
- path("{{ cookiecutter.model_class_name | lower }}/delete/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}BulkDeleteView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_bulk_delete"),
- path("{{ cookiecutter.model_class_name | lower }}/edit/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}BulkEditView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_bulk_edit"),
- path("{{ cookiecutter.model_class_name | lower }}//", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}View.as_view(), name="{{ cookiecutter.model_class_name.lower() }}"),
- path("{{ cookiecutter.model_class_name | lower }}//delete/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}DeleteView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_delete"),
- path("{{ cookiecutter.model_class_name | lower }}//edit/", {{ cookiecutter.model_class_name.lower() }}.{{ cookiecutter.model_class_name }}EditView.as_view(), name="{{ cookiecutter.model_class_name.lower() }}_edit"),
- path(
- "{{ cookiecutter.model_class_name | lower }}//changelog/",
- ObjectChangeLogView.as_view(),
- name="{{ cookiecutter.model_class_name.lower() }}_changelog",
- kwargs={"model": models.{{ cookiecutter.model_class_name }}},
- ),
-]
diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py
deleted file mode 100644
index b990ba51..00000000
--- a/nautobot-app/{{ cookiecutter.project_slug }}/{{cookiecutter.plugin_name}}/views/{{ cookiecutter.model_class_name | lower }}.py
+++ /dev/null
@@ -1,63 +0,0 @@
-"""Views for {{ cookiecutter.model_class_name }}."""
-
-from nautobot.core.views import generic
-
-from {{ cookiecutter.plugin_name }} import filters, forms, models, tables
-
-
-class {{ cookiecutter.model_class_name }}ListView(generic.ObjectListView):
- """List view."""
-
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
- # These aren't needed for simple models, but we can always add
- # this search functionality.
- filterset = filters.{{ cookiecutter.model_class_name }}FilterSet
- filterset_form = forms.{{ cookiecutter.model_class_name }}FilterForm
- table = tables.{{ cookiecutter.model_class_name }}Table
-
- # Option for modifying the top right buttons on the list view:
- # action_buttons = ("add", "import", "export")
-
-
-class {{ cookiecutter.model_class_name }}View(generic.ObjectView):
- """Detail view."""
-
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
-
-
-class {{ cookiecutter.model_class_name }}CreateView(generic.ObjectEditView):
- """Create view."""
-
- model = models.{{ cookiecutter.model_class_name }}
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
- model_form = forms.{{ cookiecutter.model_class_name }}Form
-
-
-class {{ cookiecutter.model_class_name }}DeleteView(generic.ObjectDeleteView):
- """Delete view."""
-
- model = models.{{ cookiecutter.model_class_name }}
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
-
-
-class {{ cookiecutter.model_class_name }}EditView(generic.ObjectEditView):
- """Edit view."""
-
- model = models.{{ cookiecutter.model_class_name }}
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
- model_form = forms.{{ cookiecutter.model_class_name }}Form
-
-
-class {{ cookiecutter.model_class_name }}BulkDeleteView(generic.BulkDeleteView):
- """View for deleting one or more {{ cookiecutter.model_class_name }} records."""
-
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
- table = tables.{{ cookiecutter.model_class_name }}Table
-
-
-class {{ cookiecutter.model_class_name }}BulkEditView(generic.BulkEditView):
- """View for editing one or more {{ cookiecutter.model_class_name }} records."""
-
- queryset = models.{{ cookiecutter.model_class_name }}.objects.all()
- table = tables.{{ cookiecutter.model_class_name }}Table
- form = forms.{{ cookiecutter.model_class_name }}BulkEditForm