1212from . import filters
1313
1414if TYPE_CHECKING :
15- from dcim .graphql .types import DeviceType , InterfaceType
15+ from dcim .graphql .types import DeviceType , InterfaceType , VirtualChassisType
1616 from ipam .graphql .types import AggregateType , IPAddressType , IPRangeType , PrefixType
1717 from virtualization .graphql .types import VirtualMachineType , VMInterfaceType
1818
1919
2020@strawberry_django .type (
2121 models .AccessList ,
2222 fields = "__all__" ,
23- exclude = ["assigned_object_type" , "assigned_object_id" ],
2423 filters = filters .AccessListFilter ,
2524)
2625class AccessListType (NetBoxObjectType ):
2726 """
2827 Defines the object type for the django model AccessList.
2928 """
3029
31- # Model fields
32- assigned_object_type : Annotated ["ContentTypeType" , strawberry .lazy ("netbox.graphql.types" )]
33- assigned_object : Annotated [
34- Union [
35- Annotated ["DeviceType" , strawberry .lazy ("dcim.graphql.types" )],
36- Annotated ["VirtualMachineType" , strawberry .lazy ("virtualization.graphql.types" )],
37- ],
38- strawberry .union ("ACLAssignmentType" ),
39- ]
40-
4130 # Related models
4231 aclstandardrules : List [
4332 Annotated [
@@ -51,15 +40,21 @@ class AccessListType(NetBoxObjectType):
5140 strawberry .lazy ("netbox_acls.graphql.types" ),
5241 ]
5342 ]
43+ aclassignments : List [
44+ Annotated [
45+ "ACLAssignmentType" ,
46+ strawberry .lazy ("netbox_acls.graphql.types" ),
47+ ]
48+ ]
5449
5550
5651@strawberry_django .type (
57- models .ACLInterfaceAssignment ,
52+ models .ACLAssignment ,
5853 fields = "__all__" ,
5954 exclude = ["assigned_object_type" , "assigned_object_id" ],
60- filters = filters .ACLInterfaceAssignmentFilter ,
55+ filters = filters .ACLAssignmentFilter ,
6156)
62- class ACLInterfaceAssignmentType (NetBoxObjectType ):
57+ class ACLAssignmentType (NetBoxObjectType ):
6358 """
6459 Defines the object type for the django model ACLInterfaceAssignment.
6560 """
@@ -69,10 +64,13 @@ class ACLInterfaceAssignmentType(NetBoxObjectType):
6964 assigned_object_type : Annotated ["ContentTypeType" , strawberry .lazy ("netbox.graphql.types" )]
7065 assigned_object : Annotated [
7166 Union [
67+ Annotated ["DeviceType" , strawberry .lazy ("dcim.graphql.types" )],
7268 Annotated ["InterfaceType" , strawberry .lazy ("dcim.graphql.types" )],
69+ Annotated ["VirtualChassisType" , strawberry .lazy ("dcim.graphql.types" )],
70+ Annotated ["VirtualMachineType" , strawberry .lazy ("virtualization.graphql.types" )],
7371 Annotated ["VMInterfaceType" , strawberry .lazy ("virtualization.graphql.types" )],
7472 ],
75- strawberry .union ("ACLInterfaceAssignedObjectType " ),
73+ strawberry .union ("ACLAssignedObjectType " ),
7674 ]
7775
7876
0 commit comments