Skip to content

Commit 0460aae

Browse files
committed
Merge branch 'netbox_4_3' into 'master'
NetBox 4.3 compatibility See merge request 701/netbox/cesnet_service_path_plugin!24
2 parents 7a54168 + e902e09 commit 0460aae

File tree

5 files changed

+46
-16
lines changed

5 files changed

+46
-16
lines changed

cesnet_service_path_plugin/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Top-level package for Cesnet ServicePath Plugin."""
22

33
from netbox.plugins import PluginConfig
4-
from .version import __version__, __author__, __email__, __description__, __name__
4+
5+
from .version import __description__, __name__, __version__
56

67

78
class CesnetServicePathPluginConfig(PluginConfig):
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
import strawberry_django
2-
from netbox.graphql.filter_mixins import autotype_decorator, BaseFilterMixin
2+
from netbox.graphql.filter_mixins import BaseFilterMixin
33

4-
from cesnet_service_path_plugin.models import Segment, ServicePath, ServicePathSegmentMapping, SegmentCircuitMapping
54
from cesnet_service_path_plugin.filtersets import (
5+
SegmentCircuitMappingFilterSet,
66
SegmentFilterSet,
77
ServicePathFilterSet,
8-
SegmentCircuitMappingFilterSet,
98
ServicePathSegmentMappingFilterSet,
109
)
10+
from cesnet_service_path_plugin.models import (
11+
Segment,
12+
SegmentCircuitMapping,
13+
ServicePath,
14+
ServicePathSegmentMapping,
15+
)
1116

1217

1318
@strawberry_django.filter(Segment, lookups=True)
14-
@autotype_decorator(SegmentFilterSet)
1519
class SegmentFilter(BaseFilterMixin):
16-
pass
20+
class Meta:
21+
filterset_class = SegmentFilterSet
1722

1823

1924
@strawberry_django.filter(ServicePath, lookups=True)
20-
@autotype_decorator(ServicePathFilterSet)
2125
class ServicePathFilter(BaseFilterMixin):
22-
pass
26+
class Meta:
27+
filterset_class = ServicePathFilterSet
2328

2429

2530
@strawberry_django.filter(SegmentCircuitMapping, lookups=True)
2631
class SegmentCircuitMappingFilter(SegmentCircuitMappingFilterSet):
27-
pass
32+
class Meta:
33+
filterset_class = SegmentCircuitMappingFilterSet
2834

2935

3036
@strawberry_django.filter(ServicePathSegmentMapping, lookups=True)
3137
class ServicePathSegmentMappingFilter(ServicePathSegmentMappingFilterSet):
32-
pass
38+
class Meta:
39+
filterset_class = ServicePathSegmentMappingFilterSet

cesnet_service_path_plugin/template_content.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class CircuitKomoraSegmentExtension(PluginTemplateExtension):
17-
model = "circuits.circuit"
17+
models = ["circuits.circuit"]
1818

1919
def full_width_page(self):
2020
return self.render(
@@ -23,7 +23,7 @@ def full_width_page(self):
2323

2424

2525
class ProviderSegmentExtension(PluginTemplateExtension):
26-
model = "circuits.provider"
26+
models = ["circuits.provider"]
2727

2828
def full_width_page(self):
2929
return self.render(
@@ -32,7 +32,7 @@ def full_width_page(self):
3232

3333

3434
class SiteSegmentExtension(PluginTemplateExtension):
35-
model = "dcim.site"
35+
models = ["dcim.site"]
3636

3737
def full_width_page(self):
3838
return self.render(
@@ -41,7 +41,7 @@ def full_width_page(self):
4141

4242

4343
class LocationSegmentExtension(PluginTemplateExtension):
44-
model = "dcim.location"
44+
models = ["dcim.location"]
4545

4646
def full_width_page(self):
4747
return self.render(
@@ -50,7 +50,7 @@ def full_width_page(self):
5050

5151

5252
class TenantProviderExtension(PluginTemplateExtension):
53-
model = "tenancy.tenant"
53+
models = ["tenancy.tenant"]
5454

5555
def left_page(self):
5656
provider = Provider.objects.filter(

cesnet_service_path_plugin/urls.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
ServicePathDeleteView.as_view(),
5353
name="servicepath_delete",
5454
),
55+
path(
56+
"service_paths/",
57+
include(
58+
get_model_urls("cesnet_service_path_plugin", "servicepath", detail=False)
59+
),
60+
),
5561
path(
5662
"service_paths/<int:pk>/",
5763
include(get_model_urls("cesnet_service_path_plugin", "servicepath")),
@@ -82,6 +88,14 @@
8288
ServicePathSegmentMappingDeleteView.as_view(),
8389
name="servicepathsegmentmapping_delete",
8490
),
91+
path(
92+
"service-path-segment-mappings/",
93+
include(
94+
get_model_urls(
95+
"cesnet_service_path_plugin", "servicepathsegmentmapping", detail=False
96+
)
97+
),
98+
),
8599
path(
86100
"service-path-segment-mappings/<int:pk>/",
87101
include(
@@ -114,6 +128,14 @@
114128
SegmentCircuitMappingDeleteView.as_view(),
115129
name="segmentcircuitmapping_delete",
116130
),
131+
path(
132+
"segment-circuit-mappings/",
133+
include(
134+
get_model_urls(
135+
"cesnet_service_path_plugin", "segmentcircuitmapping", detail=False
136+
)
137+
),
138+
),
117139
path(
118140
"segment-circuit-mappings/<int:pk>/",
119141
include(get_model_urls("cesnet_service_path_plugin", "segmentcircuitmapping")),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Jan Krupa"
22
__email__ = "[email protected]"
3-
__version__ = "4.0.0"
3+
__version__ = "4.3.0"
44
__description__ = "Adds ability to create service path in the CESNET network."
55
__name__ = "cesnet_service_path_plugin"

0 commit comments

Comments
 (0)