mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 21:02:23 -06:00
Rename BaseObjectTypeFilterMixin to BaseModelFilter; remove from mixins
This commit is contained in:
@@ -325,14 +325,14 @@ class CircuitTypeType(OrganizationalObjectType):
|
||||
|
||||
### Change filters.py
|
||||
|
||||
Strawberry currently doesn't directly support django-filter, so an explicit filters.py file will need to be created. NetBox includes a new `autotype_decorator` used to automatically wrap FilterSets to reduce the required code to a minimum.
|
||||
Filter classes should inherit from `netbox.graphql.filters.BaseModelFilter`.
|
||||
|
||||
```python title="New"
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
from circuits import filtersets, models
|
||||
|
||||
from netbox.graphql.filter_mixins import autotype_decorator, BaseFilter
|
||||
from netbox.graphql.filters import BaseModelFilter
|
||||
|
||||
__all__ = (
|
||||
'CircuitFilter',
|
||||
@@ -340,8 +340,7 @@ __all__ = (
|
||||
|
||||
|
||||
@strawberry_django.filter(models.Circuit, lookups=True)
|
||||
@autotype_decorator(filtersets.CircuitFilterSet)
|
||||
class CircuitFilter(BaseFilter):
|
||||
class CircuitFilter(BaseModelFilter):
|
||||
pass
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user