mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 19:18:16 -06:00
Replace typing.List with list
typing.List is deprecated since Python 3.9
This commit is contained in:
parent
6176919336
commit
1b15b381bb
@ -276,8 +276,6 @@ class CircuitsQuery(graphene.ObjectType):
|
||||
```
|
||||
|
||||
```python title="New"
|
||||
from typing import List
|
||||
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
|
||||
@ -286,7 +284,7 @@ class CircuitsQuery:
|
||||
@strawberry.field
|
||||
def circuit(self, id: int) -> CircuitType:
|
||||
return models.Circuit.objects.get(pk=id)
|
||||
circuit_list: List[CircuitType] = strawberry_django.field()
|
||||
circuit_list: list[CircuitType] = strawberry_django.field()
|
||||
```
|
||||
|
||||
### Change types.py
|
||||
@ -307,7 +305,7 @@ class CircuitType(NetBoxObjectType, ContactsMixin):
|
||||
```
|
||||
|
||||
```python title="New"
|
||||
from typing import Annotated, List
|
||||
from typing import Annotated
|
||||
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
@ -321,7 +319,7 @@ class CircuitTypeType(OrganizationalObjectType):
|
||||
color: str
|
||||
|
||||
@strawberry_django.field
|
||||
def circuits(self) -> List[Annotated["CircuitType", strawberry.lazy('circuits.graphql.types')]]:
|
||||
def circuits(self) -> list[Annotated["CircuitType", strawberry.lazy('circuits.graphql.types')]]:
|
||||
return self.circuits.all()
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user