From c3d5164003a5bded686c9439e91d2f30e211e003 Mon Sep 17 00:00:00 2001 From: Adam McCartney Date: Mon, 10 Jun 2024 10:19:47 +0200 Subject: [PATCH] Updates some import statements to work with v4.0 api Fixes some of the code segments that relate to the issue https://github.com/netbox-community/netbox-plugin-tutorial/issues/36 --- tutorial/step01-initial-setup.md | 2 +- tutorial/step07-navigation.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial/step01-initial-setup.md b/tutorial/step01-initial-setup.md index f1e58c2..f75ccbd 100644 --- a/tutorial/step01-initial-setup.md +++ b/tutorial/step01-initial-setup.md @@ -44,7 +44,7 @@ $ touch netbox_access_lists/__init__.py Next, open `__init__.py` in the text editor of your choice and import the `PluginConfig` class from NetBox at the top of the file. ```python -from extras.plugins import PluginConfig +from netbox.plugins import PluginConfig ``` ### Create the PluginConfig Class diff --git a/tutorial/step07-navigation.md b/tutorial/step07-navigation.md index 9351025..42f655f 100644 --- a/tutorial/step07-navigation.md +++ b/tutorial/step07-navigation.md @@ -16,7 +16,7 @@ $ edit navigation.py We'll need to import the `PluginMenuItem` class provided by NetBox to add new menu items; do this at the top of the file. ```python -from extras.plugins import PluginMenuItem +from netbox.plugins import PluginMenuItem ``` Next, we'll create a tuple named `menu_items`. This will hold our customized `PluginMenuItem` instances. @@ -58,8 +58,8 @@ That's much more convenient! While we're at it, we can add direct links to the "add" views for access lists and rules as buttons. We'll need to import two additional classes at the top of `navigation.py`: `PluginMenuButton` and `ButtonColorChoices`. ```python -from extras.plugins import PluginMenuButton, PluginMenuItem -from utilities.choices import ButtonColorChoices +from netbox.plugins import PluginMenuButton, PluginMenuItem +from netbox.choices import ButtonColorChoices ``` `PluginMenuButton` is used similarly to `PluginMenuItem`: Instantiate it with the necessary keyword arguments to effect a menu button. These arguments are: