mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-14 15:52:18 -06:00
Convert all id fields and enum fields to FilterLookups (with in_list and exact support)
This commit is contained in:
@@ -5,7 +5,7 @@ from typing import Annotated, TYPE_CHECKING
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
from strawberry import ID
|
||||
from strawberry_django import DatetimeFilterLookup
|
||||
from strawberry_django import FilterLookup, DatetimeFilterLookup
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .filters import *
|
||||
@@ -23,12 +23,12 @@ class BaseFilterMixin: ...
|
||||
|
||||
@dataclass
|
||||
class BaseObjectTypeFilterMixin(BaseFilterMixin):
|
||||
id: ID | None = strawberry.UNSET
|
||||
id: FilterLookup[ID] | None = strawberry_django.filter_field()
|
||||
|
||||
|
||||
@dataclass
|
||||
class ChangeLogFilterMixin(BaseFilterMixin):
|
||||
id: ID | None = strawberry.UNSET
|
||||
id: FilterLookup[ID] | None = strawberry_django.filter_field()
|
||||
changelog: Annotated['ObjectChangeFilter', strawberry.lazy('core.graphql.filters')] | None = (
|
||||
strawberry_django.filter_field()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user