Skip to content

Commit 5922caa

Browse files
committed
refactor(graphql): Replace ACLInterfaceAssignment with ACLAssignment
Renames `ACLInterfaceAssignmentFilter` to `ACLAssignmentFilter` and updates related imports and fields. Removes legacy fields from the filter and adjusts field placement for consistency with the unified model structure.
1 parent 9fdc3fc commit 5922caa

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from .access_list_rules import ACLExtendedRuleFilter, ACLStandardRuleFilter
2-
from .access_lists import AccessListFilter, ACLInterfaceAssignmentFilter
2+
from .access_lists import AccessListFilter, ACLAssignmentFilter
33

44
__all__ = (
55
"AccessListFilter",
66
"ACLExtendedRuleFilter",
7-
"ACLInterfaceAssignmentFilter",
7+
"ACLAssignmentFilter",
88
"ACLStandardRuleFilter",
99
)

netbox_acls/graphql/filters/access_lists.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
__all__ = (
2121
"AccessListFilter",
22-
"ACLInterfaceAssignmentFilter",
22+
"ACLAssignmentFilter",
2323
)
2424

2525

@@ -30,10 +30,6 @@ class AccessListFilter(NetBoxModelFilterMixin):
3030
"""
3131

3232
name: FilterLookup[str] | None = strawberry_django.filter_field()
33-
assigned_object_type: Annotated["ContentTypeFilter", strawberry.lazy("core.graphql.filters")] | None = (
34-
strawberry_django.filter_field()
35-
)
36-
assigned_object_id: ID | None = strawberry_django.filter_field()
3733
type: Annotated["ACLTypeEnum", strawberry.lazy("netbox_acls.graphql.enums")] | None = (
3834
strawberry_django.filter_field()
3935
)
@@ -42,20 +38,20 @@ class AccessListFilter(NetBoxModelFilterMixin):
4238
)
4339

4440

45-
@strawberry_django.filter(models.ACLInterfaceAssignment, lookups=True)
46-
class ACLInterfaceAssignmentFilter(NetBoxModelFilterMixin):
41+
@strawberry_django.filter(models.ACLAssignment, lookups=True)
42+
class ACLAssignmentFilter(NetBoxModelFilterMixin):
4743
"""
48-
GraphQL filter definition for the ACLInterfaceAssignment model.
44+
GraphQL filter definition for the ACLAssignment model.
4945
"""
5046

5147
access_list: Annotated["AccessListFilter", strawberry.lazy("netbox_acls.graphql.filters")] | None = (
5248
strawberry_django.filter_field()
5349
)
5450
access_list_id: ID | None = strawberry_django.filter_field()
55-
direction: Annotated["ACLAssignmentDirectionEnum", strawberry.lazy("netbox_acls.graphql.enums")] | None = (
56-
strawberry_django.filter_field()
57-
)
5851
assigned_object_type: Annotated["ContentTypeFilter", strawberry.lazy("core.graphql.filters")] | None = (
5952
strawberry_django.filter_field()
6053
)
6154
assigned_object_id: ID | None = strawberry_django.filter_field()
55+
direction: Annotated["ACLAssignmentDirectionEnum", strawberry.lazy("netbox_acls.graphql.enums")] | None = (
56+
strawberry_django.filter_field()
57+
)

0 commit comments

Comments
 (0)