66from typing import Annotated
77from netbox .graphql .filter_mixins import NetBoxModelFilterMixin
88from tenancy .graphql .filter_mixins import TenancyFilterMixin
9-
10-
9+ from ipam . graphql . filters import IPAddressFilter , ASNFilter
10+ from dcim . graphql . filter import DeviceFilter
1111
1212from netbox_bgp .models import (
1313 Community ,
3333 CommunityListRuleFilterSet ,
3434)
3535
36+ from netbox_bgp .graphql .enums import (
37+ NetBoxBGPCommunityStatusEnum ,
38+ NetBoxBGPSessionStatusEnum ,
39+ NetBoxBGPIPAddressFamilyEnum ,
40+ NetBoxBGPActionEnum
41+ )
42+
3643
3744__all__ = (
3845 "NetBoxBGPCommunityFilter" ,
4754)
4855
4956
50- @strawberry_django .filter (Community , lookups = True )
57+ @strawberry_django .filter_type (Community , lookups = True )
5158class NetBoxBGPCommunityFilter (TenancyFilterMixin , NetBoxModelFilterMixin ):
5259 value : FilterLookup [str ] | None = strawberry_django .filter_field ()
5360 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
@@ -59,7 +66,7 @@ class NetBoxBGPCommunityFilter(TenancyFilterMixin, NetBoxModelFilterMixin):
5966 ) = strawberry_django .filter_field ()
6067
6168
62- @strawberry_django .filter (BGPSession , lookups = True )
69+ @strawberry_django .filter_type (BGPSession , lookups = True )
6370class NetBoxBGPSessionFilter (TenancyFilterMixin , NetBoxModelFilterMixin ):
6471 name : FilterLookup [str ] | None = strawberry_django .filter_field ()
6572 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
@@ -119,17 +126,17 @@ class NetBoxBGPSessionFilter(TenancyFilterMixin, NetBoxModelFilterMixin):
119126
120127
121128
122- @strawberry_django .filter (BGPPeerGroup , lookups = True )
129+ @strawberry_django .filter_type (BGPPeerGroup , lookups = True )
123130class NetBoxBGPBGPPeerGroupFilter (NetBoxModelFilterMixin ):
124131 name : FilterLookup [str ] | None = strawberry_django .filter_field ()
125132 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
126133
127- @strawberry_django .filter (RoutingPolicy , lookups = True )
134+ @strawberry_django .filter_type (RoutingPolicy , lookups = True )
128135class NetBoxBGPRoutingPolicyFilter (NetBoxModelFilterMixin ):
129136 name : FilterLookup [str ] | None = strawberry_django .filter_field ()
130137 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
131138
132- @strawberry_django .filter (RoutingPolicyRule , lookups = True )
139+ @strawberry_django .filter_type (RoutingPolicyRule , lookups = True )
133140class NetBoxBGPRoutingPolicyRuleFilter (NetBoxModelFilterMixin ):
134141 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
135142 routing_policy : (
@@ -147,7 +154,7 @@ class NetBoxBGPRoutingPolicyRuleFilter(NetBoxModelFilterMixin):
147154 ) = strawberry_django .filter_field ()
148155
149156
150- @strawberry_django .filter (PrefixList , lookups = True )
157+ @strawberry_django .filter_type (PrefixList , lookups = True )
151158class NetBoxBGPPrefixListFilter (NetBoxModelFilterMixin ):
152159 name : FilterLookup [str ] | None = strawberry_django .filter_field ()
153160 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
@@ -159,7 +166,7 @@ class NetBoxBGPPrefixListFilter(NetBoxModelFilterMixin):
159166 ) = strawberry_django .filter_field ()
160167
161168
162- @strawberry_django .filter (PrefixListRule , lookups = True )
169+ @strawberry_django .filter_type (PrefixListRule , lookups = True )
163170class NetBoxBGPPrefixListRuleFilter (NetBoxModelFilterMixin ):
164171 action : (
165172 Annotated [
@@ -177,13 +184,13 @@ class NetBoxBGPPrefixListRuleFilter(NetBoxModelFilterMixin):
177184
178185
179186
180- @strawberry_django .filter (CommunityList , lookups = True )
187+ @strawberry_django .filter_type (CommunityList , lookups = True )
181188class NetBoxBGPCommunityListFilter (NetBoxModelFilterMixin ):
182189 name : FilterLookup [str ] | None = strawberry_django .filter_field ()
183190 description : FilterLookup [str ] | None = strawberry_django .filter_field ()
184191
185192
186- @strawberry_django .filter (CommunityListRule , lookups = True )
193+ @strawberry_django .filter_type (CommunityListRule , lookups = True )
187194class NetBoxBGPCommunityListRuleFilter (NetBoxModelFilterMixin ):
188195 action : (
189196 Annotated [
0 commit comments