nautobot-dev-example 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nautobot_dev_example-1.0.0/LICENSE +15 -0
- nautobot_dev_example-1.0.0/PKG-INFO +76 -0
- nautobot_dev_example-1.0.0/README.md +51 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/__init__.py +27 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/api/__init__.py +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/api/serializers.py +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/api/urls.py +11 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/api/views.py +17 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/app-config-schema.json +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/filters.py +17 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/forms.py +47 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/migrations/0001_initial.py +47 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/migrations/__init__.py +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/models.py +38 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/navigation.py +24 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/404.html +961 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/compatibility_matrix.html +1064 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/install.html +1227 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/release_notes/index.html +1041 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/release_notes/version_1.0.html +1192 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/uninstall.html +1132 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/admin/upgrade.html +1097 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/_mkdocstrings.css +64 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/extra.css +166 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/favicon.ico +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/images/favicon.png +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/bundle.b4d07000.min.js +29 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/bundle.b4d07000.min.js.map +8 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/tinyseg.js +206 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/lunr/wordcut.js +6708 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/workers/search.208ed371.min.js +42 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/javascripts/workers/search.208ed371.min.js.map +8 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/nautobot_logo.png +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/nautobot_logo.svg +131 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/networktocode_bw.png +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/overrides/partials/copyright.html +22 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/stylesheets/main.26e3688c.min.css +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/stylesheets/main.26e3688c.min.css.map +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/stylesheets/palette.ecc896b0.min.css +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/assets/stylesheets/palette.ecc896b0.min.css.map +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/arch_decision.html +1049 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/code_reference/api.html +1517 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/code_reference/index.html +1041 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/code_reference/package.html +1222 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/contributing.html +1161 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/dev_environment.html +1912 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/extending.html +1049 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/dev/release_checklist.html +1373 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/images/icon-nautobot-dev-example.png +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/index.html +1200 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/objects.inv +7 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/requirements.txt +5 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/search/search_index.json +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/sitemap.xml +103 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/sitemap.xml.gz +0 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/user/app_getting_started.html +1128 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/user/app_overview.html +1172 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/user/app_use_cases.html +1126 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/user/external_interactions.html +1153 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/static/nautobot_dev_example/docs/user/faq.html +1048 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tables.py +38 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/templates/nautobot_dev_example/devexample_retrieve.html +26 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/__init__.py +1 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/fixtures.py +10 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_api.py +28 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_api_views.py +27 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_basic.py +25 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_filter_devexample.py +28 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_form_devexample.py +33 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_model_devexample.py +22 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/tests/test_views.py +28 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/urls.py +10 -0
- nautobot_dev_example-1.0.0/nautobot_dev_example/views.py +19 -0
- nautobot_dev_example-1.0.0/pyproject.toml +188 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache Software License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Network to Code, LLC
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: nautobot-dev-example
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Nautobot App to demonstrate how to create a Nautobot App.
|
|
5
|
+
Home-page: https://github.com/nautobot/nautobot-app-dev-example
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: nautobot,nautobot-app,nautobot-plugin
|
|
8
|
+
Author: Network to Code, LLC
|
|
9
|
+
Author-email: opensource@networktocode.com
|
|
10
|
+
Requires-Python: >=3.8,<3.12
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Provides-Extra: all
|
|
20
|
+
Requires-Dist: nautobot (>=2.0.0,<3.0.0)
|
|
21
|
+
Project-URL: Documentation, https://docs.nautobot.com/projects/dev-example/en/latest/
|
|
22
|
+
Project-URL: Repository, https://github.com/nautobot/nautobot-app-dev-example
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# Nautobot Dev Example App
|
|
26
|
+
|
|
27
|
+
This application serves as a testbed for evaluating improvements to the [Nautobot App Cookiecutter Templates](https://github.com/nautobot/cookiecutter-nautobot-app). **DO NOT USE** this repository directly in production environments or to bootstrap a new app!
|
|
28
|
+
|
|
29
|
+
For those wanting to develop a new Nautobot app, please use the [cookiecutter template](https://github.com/nautobot/cookiecutter-nautobot-app) as a starting point.
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/nautobot/nautobot-app-dev-example/develop/docs/images/icon-nautobot-dev-example.png" class="logo" height="200px">
|
|
33
|
+
<br>
|
|
34
|
+
<a href="https://github.com/nautobot/nautobot-app-dev-example/actions"><img src="https://github.com/nautobot/nautobot-app-dev-example/actions/workflows/ci.yml/badge.svg?branch=main"></a>
|
|
35
|
+
<a href="https://docs.nautobot.com/projects/dev-example/en/latest/"><img src="https://readthedocs.org/projects/nautobot-plugin-dev-example/badge/"></a>
|
|
36
|
+
<a href="https://pypi.org/project/nautobot-dev-example/"><img src="https://img.shields.io/pypi/v/nautobot-dev-example"></a>
|
|
37
|
+
<a href="https://pypi.org/project/nautobot-dev-example/"><img src="https://img.shields.io/pypi/dm/nautobot-dev-example"></a>
|
|
38
|
+
<br>
|
|
39
|
+
An <a href="https://networktocode.com/nautobot-apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
## Overview
|
|
43
|
+
|
|
44
|
+
An example Nautobot app with multiple functions:
|
|
45
|
+
|
|
46
|
+
- Acts as a Canary App to test enhancements to the Nautobot app [cookiecutter templates](https://github.com/nautobot/cookiecutter-nautobot-app).
|
|
47
|
+
- Illustrates how to use the Nautobot app framework.
|
|
48
|
+
|
|
49
|
+
### Screenshots
|
|
50
|
+
|
|
51
|
+
More screenshots can be found in the [Using the App](https://docs.nautobot.com/projects/dev-example/en/latest/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the app's added functionality:
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
Full documentation for this App can be found over on the [Nautobot Docs](https://docs.nautobot.com) website:
|
|
58
|
+
|
|
59
|
+
- [User Guide](https://docs.nautobot.com/projects/dev-example/en/latest/user/app_overview/) - Overview, Using the App, Getting Started.
|
|
60
|
+
- [Administrator Guide](https://docs.nautobot.com/projects/dev-example/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
|
|
61
|
+
- [Developer Guide](https://docs.nautobot.com/projects/dev-example/en/latest/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
|
|
62
|
+
- [Release Notes / Changelog](https://docs.nautobot.com/projects/dev-example/en/latest/admin/release_notes/).
|
|
63
|
+
- [Frequently Asked Questions](https://docs.nautobot.com/projects/dev-example/en/latest/user/faq/).
|
|
64
|
+
|
|
65
|
+
### Contributing to the Documentation
|
|
66
|
+
|
|
67
|
+
You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/nautobot/nautobot-app-dev-example/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
|
|
68
|
+
|
|
69
|
+
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](https://docs.nautobot.com/projects/dev-example/en/latest/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.
|
|
70
|
+
|
|
71
|
+
Any PRs with fixes or improvements are very welcome!
|
|
72
|
+
|
|
73
|
+
## Questions
|
|
74
|
+
|
|
75
|
+
For any questions or comments, please check the [FAQ](https://docs.nautobot.com/projects/dev-example/en/latest/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.
|
|
76
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Nautobot Dev Example App
|
|
2
|
+
|
|
3
|
+
This application serves as a testbed for evaluating improvements to the [Nautobot App Cookiecutter Templates](https://github.com/nautobot/cookiecutter-nautobot-app). **DO NOT USE** this repository directly in production environments or to bootstrap a new app!
|
|
4
|
+
|
|
5
|
+
For those wanting to develop a new Nautobot app, please use the [cookiecutter template](https://github.com/nautobot/cookiecutter-nautobot-app) as a starting point.
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://raw.githubusercontent.com/nautobot/nautobot-app-dev-example/develop/docs/images/icon-nautobot-dev-example.png" class="logo" height="200px">
|
|
9
|
+
<br>
|
|
10
|
+
<a href="https://github.com/nautobot/nautobot-app-dev-example/actions"><img src="https://github.com/nautobot/nautobot-app-dev-example/actions/workflows/ci.yml/badge.svg?branch=main"></a>
|
|
11
|
+
<a href="https://docs.nautobot.com/projects/dev-example/en/latest/"><img src="https://readthedocs.org/projects/nautobot-plugin-dev-example/badge/"></a>
|
|
12
|
+
<a href="https://pypi.org/project/nautobot-dev-example/"><img src="https://img.shields.io/pypi/v/nautobot-dev-example"></a>
|
|
13
|
+
<a href="https://pypi.org/project/nautobot-dev-example/"><img src="https://img.shields.io/pypi/dm/nautobot-dev-example"></a>
|
|
14
|
+
<br>
|
|
15
|
+
An <a href="https://networktocode.com/nautobot-apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
An example Nautobot app with multiple functions:
|
|
21
|
+
|
|
22
|
+
- Acts as a Canary App to test enhancements to the Nautobot app [cookiecutter templates](https://github.com/nautobot/cookiecutter-nautobot-app).
|
|
23
|
+
- Illustrates how to use the Nautobot app framework.
|
|
24
|
+
|
|
25
|
+
### Screenshots
|
|
26
|
+
|
|
27
|
+
More screenshots can be found in the [Using the App](https://docs.nautobot.com/projects/dev-example/en/latest/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the app's added functionality:
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
Full documentation for this App can be found over on the [Nautobot Docs](https://docs.nautobot.com) website:
|
|
34
|
+
|
|
35
|
+
- [User Guide](https://docs.nautobot.com/projects/dev-example/en/latest/user/app_overview/) - Overview, Using the App, Getting Started.
|
|
36
|
+
- [Administrator Guide](https://docs.nautobot.com/projects/dev-example/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the App.
|
|
37
|
+
- [Developer Guide](https://docs.nautobot.com/projects/dev-example/en/latest/dev/contributing/) - Extending the App, Code Reference, Contribution Guide.
|
|
38
|
+
- [Release Notes / Changelog](https://docs.nautobot.com/projects/dev-example/en/latest/admin/release_notes/).
|
|
39
|
+
- [Frequently Asked Questions](https://docs.nautobot.com/projects/dev-example/en/latest/user/faq/).
|
|
40
|
+
|
|
41
|
+
### Contributing to the Documentation
|
|
42
|
+
|
|
43
|
+
You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/nautobot/nautobot-app-dev-example/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
|
|
44
|
+
|
|
45
|
+
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](https://docs.nautobot.com/projects/dev-example/en/latest/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.
|
|
46
|
+
|
|
47
|
+
Any PRs with fixes or improvements are very welcome!
|
|
48
|
+
|
|
49
|
+
## Questions
|
|
50
|
+
|
|
51
|
+
For any questions or comments, please check the [FAQ](https://docs.nautobot.com/projects/dev-example/en/latest/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.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""App declaration for nautobot_dev_example."""
|
|
2
|
+
|
|
3
|
+
# Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added
|
|
4
|
+
from importlib import metadata
|
|
5
|
+
|
|
6
|
+
from nautobot.apps import NautobotAppConfig
|
|
7
|
+
|
|
8
|
+
__version__ = metadata.version(__name__)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class NautobotDevExampleConfig(NautobotAppConfig):
|
|
12
|
+
"""App configuration for the nautobot_dev_example app."""
|
|
13
|
+
|
|
14
|
+
name = "nautobot_dev_example"
|
|
15
|
+
verbose_name = "Nautobot Dev Example App"
|
|
16
|
+
version = __version__
|
|
17
|
+
author = "Network to Code, LLC"
|
|
18
|
+
description = "Nautobot App to demonstrate how to create a Nautobot App.."
|
|
19
|
+
base_url = "dev-example"
|
|
20
|
+
required_settings = []
|
|
21
|
+
min_version = "2.0.0"
|
|
22
|
+
max_version = "2.9999"
|
|
23
|
+
default_settings = {}
|
|
24
|
+
caching_config = {}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
config = NautobotDevExampleConfig # pylint:disable=invalid-name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""REST API module for nautobot_dev_example app."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""API serializers for nautobot_dev_example."""
|
|
2
|
+
|
|
3
|
+
from nautobot.apps.api import NautobotModelSerializer, TaggedModelSerializerMixin
|
|
4
|
+
|
|
5
|
+
from nautobot_dev_example import models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DevExampleSerializer(NautobotModelSerializer, TaggedModelSerializerMixin): # pylint: disable=too-many-ancestors
|
|
9
|
+
"""DevExample Serializer."""
|
|
10
|
+
|
|
11
|
+
class Meta:
|
|
12
|
+
"""Meta attributes."""
|
|
13
|
+
|
|
14
|
+
model = models.DevExample
|
|
15
|
+
fields = "__all__"
|
|
16
|
+
|
|
17
|
+
# Option for disabling write for certain fields:
|
|
18
|
+
# read_only_fields = []
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Django API urlpatterns declaration for nautobot_dev_example app."""
|
|
2
|
+
|
|
3
|
+
from nautobot.apps.api import OrderedDefaultRouter
|
|
4
|
+
|
|
5
|
+
from nautobot_dev_example.api import views
|
|
6
|
+
|
|
7
|
+
router = OrderedDefaultRouter()
|
|
8
|
+
# add the name of your api endpoint, usually hyphenated model name in plural, e.g. "my-model-classes"
|
|
9
|
+
router.register("devexample", views.DevExampleViewSet)
|
|
10
|
+
|
|
11
|
+
urlpatterns = router.urls
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""API views for nautobot_dev_example."""
|
|
2
|
+
|
|
3
|
+
from nautobot.apps.api import NautobotModelViewSet
|
|
4
|
+
|
|
5
|
+
from nautobot_dev_example import filters, models
|
|
6
|
+
from nautobot_dev_example.api import serializers
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DevExampleViewSet(NautobotModelViewSet): # pylint: disable=too-many-ancestors
|
|
10
|
+
"""DevExample viewset."""
|
|
11
|
+
|
|
12
|
+
queryset = models.DevExample.objects.all()
|
|
13
|
+
serializer_class = serializers.DevExampleSerializer
|
|
14
|
+
filterset_class = filters.DevExampleFilterSet
|
|
15
|
+
|
|
16
|
+
# Option for modifying the default HTTP methods:
|
|
17
|
+
# http_method_names = ["get", "post", "put", "patch", "delete", "head", "options", "trace"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Filtering for nautobot_dev_example."""
|
|
2
|
+
|
|
3
|
+
from nautobot.apps.filters import NameSearchFilterSet, NautobotFilterSet
|
|
4
|
+
|
|
5
|
+
from nautobot_dev_example import models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DevExampleFilterSet(NautobotFilterSet, NameSearchFilterSet): # pylint: disable=too-many-ancestors
|
|
9
|
+
"""Filter for DevExample."""
|
|
10
|
+
|
|
11
|
+
class Meta:
|
|
12
|
+
"""Meta attributes for filter."""
|
|
13
|
+
|
|
14
|
+
model = models.DevExample
|
|
15
|
+
|
|
16
|
+
# add any fields from the model that you would like to filter your searches by using those
|
|
17
|
+
fields = ["id", "name", "description"]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Forms for nautobot_dev_example."""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from nautobot.apps.forms import NautobotBulkEditForm, NautobotFilterForm, NautobotModelForm, TagsBulkEditFormMixin
|
|
5
|
+
|
|
6
|
+
from nautobot_dev_example import models
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DevExampleForm(NautobotModelForm): # pylint: disable=too-many-ancestors
|
|
10
|
+
"""DevExample creation/edit form."""
|
|
11
|
+
|
|
12
|
+
class Meta:
|
|
13
|
+
"""Meta attributes."""
|
|
14
|
+
|
|
15
|
+
model = models.DevExample
|
|
16
|
+
fields = [
|
|
17
|
+
"name",
|
|
18
|
+
"description",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class DevExampleBulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm): # pylint: disable=too-many-ancestors
|
|
23
|
+
"""DevExample bulk edit form."""
|
|
24
|
+
|
|
25
|
+
pk = forms.ModelMultipleChoiceField(queryset=models.DevExample.objects.all(), widget=forms.MultipleHiddenInput)
|
|
26
|
+
description = forms.CharField(required=False)
|
|
27
|
+
|
|
28
|
+
class Meta:
|
|
29
|
+
"""Meta attributes."""
|
|
30
|
+
|
|
31
|
+
nullable_fields = [
|
|
32
|
+
"description",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class DevExampleFilterForm(NautobotFilterForm):
|
|
37
|
+
"""Filter form to filter searches."""
|
|
38
|
+
|
|
39
|
+
model = models.DevExample
|
|
40
|
+
field_order = ["q", "name"]
|
|
41
|
+
|
|
42
|
+
q = forms.CharField(
|
|
43
|
+
required=False,
|
|
44
|
+
label="Search",
|
|
45
|
+
help_text="Search within Name or Slug.",
|
|
46
|
+
)
|
|
47
|
+
name = forms.CharField(required=False, label="Name")
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Generated by Django 3.2.21 on 2024-02-16 08:32
|
|
2
|
+
|
|
3
|
+
import uuid
|
|
4
|
+
|
|
5
|
+
import django.core.serializers.json
|
|
6
|
+
import nautobot.core.models.fields
|
|
7
|
+
import nautobot.extras.models.mixins
|
|
8
|
+
from django.db import migrations, models
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Migration(migrations.Migration):
|
|
12
|
+
initial = True
|
|
13
|
+
|
|
14
|
+
dependencies = [
|
|
15
|
+
("extras", "0098_rename_data_jobresult_result"),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
operations = [
|
|
19
|
+
migrations.CreateModel(
|
|
20
|
+
name="DevExample",
|
|
21
|
+
fields=[
|
|
22
|
+
(
|
|
23
|
+
"id",
|
|
24
|
+
models.UUIDField(
|
|
25
|
+
default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
("created", models.DateTimeField(auto_now_add=True, null=True)),
|
|
29
|
+
("last_updated", models.DateTimeField(auto_now=True, null=True)),
|
|
30
|
+
(
|
|
31
|
+
"_custom_field_data",
|
|
32
|
+
models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder),
|
|
33
|
+
),
|
|
34
|
+
("name", models.CharField(max_length=100, unique=True)),
|
|
35
|
+
("description", models.CharField(blank=True, max_length=200)),
|
|
36
|
+
("tags", nautobot.core.models.fields.TagsField(through="extras.TaggedItem", to="extras.Tag")),
|
|
37
|
+
],
|
|
38
|
+
options={
|
|
39
|
+
"ordering": ["name"],
|
|
40
|
+
},
|
|
41
|
+
bases=(
|
|
42
|
+
models.Model,
|
|
43
|
+
nautobot.extras.models.mixins.DynamicGroupMixin,
|
|
44
|
+
nautobot.extras.models.mixins.NotesMixin,
|
|
45
|
+
),
|
|
46
|
+
),
|
|
47
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Models for Nautobot Dev Example App."""
|
|
2
|
+
|
|
3
|
+
# Django imports
|
|
4
|
+
from django.db import models
|
|
5
|
+
|
|
6
|
+
# Nautobot imports
|
|
7
|
+
from nautobot.apps.models import PrimaryModel
|
|
8
|
+
|
|
9
|
+
# from nautobot.extras.utils import extras_features
|
|
10
|
+
# If you want to use the extras_features decorator please reference the following documentation
|
|
11
|
+
# https://docs.nautobot.com/projects/core/en/latest/plugins/development/#using-the-extras_features-decorator-for-graphql
|
|
12
|
+
# Then based on your reading you may decide to put the following decorator before the declaration of your class
|
|
13
|
+
# @extras_features("custom_fields", "custom_validators", "relationships", "graphql")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# If you want to choose a specific model to overload in your class declaration, please reference the following documentation:
|
|
17
|
+
# how to chose a database model: https://docs.nautobot.com/projects/core/en/stable/plugins/development/#database-models
|
|
18
|
+
class DevExample(PrimaryModel): # pylint: disable=too-many-ancestors
|
|
19
|
+
"""Base model for Nautobot Dev Example App app."""
|
|
20
|
+
|
|
21
|
+
name = models.CharField(max_length=100, unique=True)
|
|
22
|
+
description = models.CharField(max_length=200, blank=True)
|
|
23
|
+
# additional model fields
|
|
24
|
+
|
|
25
|
+
class Meta:
|
|
26
|
+
"""Meta class."""
|
|
27
|
+
|
|
28
|
+
ordering = ["name"]
|
|
29
|
+
|
|
30
|
+
# Option for fixing capitalization (i.e. "Snmp" vs "SNMP")
|
|
31
|
+
# verbose_name = "Nautobot Dev Example App"
|
|
32
|
+
|
|
33
|
+
# Option for fixing plural name (i.e. "Chicken Tenders" vs "Chicken Tendies")
|
|
34
|
+
# verbose_name_plural = "Nautobot Dev Example Apps"
|
|
35
|
+
|
|
36
|
+
def __str__(self):
|
|
37
|
+
"""Stringify instance."""
|
|
38
|
+
return self.name
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Menu items."""
|
|
2
|
+
|
|
3
|
+
from nautobot.apps.ui import NavMenuAddButton, NavMenuGroup, NavMenuItem, NavMenuTab
|
|
4
|
+
|
|
5
|
+
items = (
|
|
6
|
+
NavMenuItem(
|
|
7
|
+
link="plugins:nautobot_dev_example:devexample_list",
|
|
8
|
+
name="Nautobot Dev Example App",
|
|
9
|
+
permissions=["nautobot_dev_example.view_devexample"],
|
|
10
|
+
buttons=(
|
|
11
|
+
NavMenuAddButton(
|
|
12
|
+
link="plugins:nautobot_dev_example:devexample_add",
|
|
13
|
+
permissions=["nautobot_dev_example.add_devexample"],
|
|
14
|
+
),
|
|
15
|
+
),
|
|
16
|
+
),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
menu_items = (
|
|
20
|
+
NavMenuTab(
|
|
21
|
+
name="Apps",
|
|
22
|
+
groups=(NavMenuGroup(name="Nautobot Dev Example App", items=tuple(items)),),
|
|
23
|
+
),
|
|
24
|
+
)
|