Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates some import statements to work with v4.0 api #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tutorial/step01-initial-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tutorial/step07-navigation.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your PR however - as per migration v4 guide ButtonColorChoices should be removed to fit the new UII

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down