Closes #21473: Enable UP rules and modernize string formatting (#21488)

This commit is contained in:
Martin Hauser
2026-02-19 17:25:08 +01:00
committed by GitHub
parent 2c200a4fd3
commit 1b295f1d69
51 changed files with 657 additions and 648 deletions

View File

@@ -1,5 +1,3 @@
from typing import List
import strawberry
import strawberry_django
@@ -9,10 +7,10 @@ from .types import *
@strawberry.type(name="Query")
class WirelessQuery:
wireless_lan: WirelessLANType = strawberry_django.field()
wireless_lan_list: List[WirelessLANType] = strawberry_django.field()
wireless_lan_list: list[WirelessLANType] = strawberry_django.field()
wireless_lan_group: WirelessLANGroupType = strawberry_django.field()
wireless_lan_group_list: List[WirelessLANGroupType] = strawberry_django.field()
wireless_lan_group_list: list[WirelessLANGroupType] = strawberry_django.field()
wireless_link: WirelessLinkType = strawberry_django.field()
wireless_link_list: List[WirelessLinkType] = strawberry_django.field()
wireless_link_list: list[WirelessLinkType] = strawberry_django.field()

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Annotated, List, Union
from typing import TYPE_CHECKING, Annotated
import strawberry
import strawberry_django
@@ -29,8 +29,8 @@ __all__ = (
class WirelessLANGroupType(NestedGroupObjectType):
parent: Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')] | None
wireless_lans: List[Annotated["WirelessLANType", strawberry.lazy('wireless.graphql.types')]]
children: List[Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')]]
wireless_lans: list[Annotated["WirelessLANType", strawberry.lazy('wireless.graphql.types')]]
children: list[Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')]]
@strawberry_django.type(
@@ -44,15 +44,16 @@ class WirelessLANType(PrimaryObjectType):
vlan: Annotated["VLANType", strawberry.lazy('ipam.graphql.types')] | None
tenant: Annotated["TenantType", strawberry.lazy('tenancy.graphql.types')] | None
interfaces: List[Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')]]
interfaces: list[Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')]]
@strawberry_django.field
def scope(self) -> Annotated[Union[
Annotated["LocationType", strawberry.lazy('dcim.graphql.types')],
Annotated["RegionType", strawberry.lazy('dcim.graphql.types')],
Annotated["SiteGroupType", strawberry.lazy('dcim.graphql.types')],
Annotated["SiteType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("WirelessLANScopeType")] | None:
def scope(self) -> Annotated[
Annotated['LocationType', strawberry.lazy('dcim.graphql.types')]
| Annotated['RegionType', strawberry.lazy('dcim.graphql.types')]
| Annotated['SiteGroupType', strawberry.lazy('dcim.graphql.types')]
| Annotated['SiteType', strawberry.lazy('dcim.graphql.types')],
strawberry.union('WirelessLANScopeType'),
] | None:
return self.scope