-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Kani999/65-nested-serializers-are-being-d…
…eprecaded-from-netbox-4 BugFix: Nested serializers are being deprecaded from netbox 4
- Loading branch information
Showing
20 changed files
with
353 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from netbox.api.routers import NetBoxRouter | ||
|
||
from . import views | ||
from netbox_attachments.api import views | ||
|
||
app_name = 'netbox_attachments' | ||
app_name = "netbox_attachments" | ||
router = NetBoxRouter() | ||
router.register('netbox-attachments', views.NetBoxAttachmentViewSet) | ||
router.register("netbox-attachments", views.NetBoxAttachmentViewSet) | ||
|
||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
netbox_attachments/migrations/0006_rename_content_type_netboxattachment_object_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 5.0.6 on 2024-07-16 12:19 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("netbox_attachments", "0005_netboxattachment_description"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="netboxattachment", | ||
old_name="content_type", | ||
new_name="object_type", | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
netbox_attachments/migrations/0007_alter_netboxattachment_object_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 5.0.6 on 2024-07-16 12:57 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0010_gfk_indexes"), | ||
("netbox_attachments", "0006_rename_content_type_netboxattachment_object_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="netboxattachment", | ||
name="object_type", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="core.objecttype" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
from netbox.plugins import PluginMenu, PluginMenuItem | ||
|
||
menu = PluginMenu( | ||
label='Attachments', | ||
label="Attachments", | ||
icon_class="mdi mdi-paperclip", | ||
groups=( | ||
("", ( | ||
PluginMenuItem( | ||
link="plugins:netbox_attachments:netboxattachment_list", | ||
link_text="NetBox Attachments", | ||
permissions=['netbox_attachments.view_netboxattachment'] | ||
( | ||
"", | ||
( | ||
PluginMenuItem( | ||
link="plugins:netbox_attachments:netboxattachment_list", | ||
link_text="NetBox Attachments", | ||
permissions=["netbox_attachments.view_netboxattachment"], | ||
), | ||
), | ||
)), | ||
), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
from netbox.search import SearchIndex, register_search | ||
from .models import NetBoxAttachment | ||
|
||
from netbox_attachments.models import NetBoxAttachment | ||
|
||
|
||
@register_search | ||
class NetBoxAttachmentIndex(SearchIndex): | ||
model = NetBoxAttachment | ||
fields = ( | ||
('name', 100), | ||
('description', 200), | ||
('comments', 5000), | ||
("name", 100), | ||
("description", 200), | ||
("comments", 5000), | ||
) |
Oops, something went wrong.