|
1 |
| -import strawberry_django |
2 |
| -from netbox.graphql.filter_mixins import BaseFilterMixin, autotype_decorator |
3 |
| - |
4 |
| -from netbox_config_diff.filtersets import ( |
5 |
| - ConfigComplianceFilterSet, |
6 |
| - ConfigurationRequestFilterSet, |
7 |
| - PlatformSettingFilterSet, |
8 |
| - SubstituteFilterSet, |
9 |
| -) |
10 |
| -from netbox_config_diff.models import ConfigCompliance, ConfigurationRequest, PlatformSetting, Substitute |
11 |
| - |
12 |
| - |
13 |
| -@strawberry_django.filter(ConfigCompliance, lookups=True) |
14 |
| -@autotype_decorator(ConfigComplianceFilterSet) |
15 |
| -class ConfigComplianceFilter(BaseFilterMixin): |
16 |
| - pass |
17 |
| - |
18 |
| - |
19 |
| -@strawberry_django.filter(ConfigurationRequest, lookups=True) |
20 |
| -@autotype_decorator(ConfigurationRequestFilterSet) |
21 |
| -class ConfigurationRequestFilter(BaseFilterMixin): |
22 |
| - pass |
23 |
| - |
24 |
| - |
25 |
| -@strawberry_django.filter(PlatformSetting, lookups=True) |
26 |
| -@autotype_decorator(PlatformSettingFilterSet) |
27 |
| -class PlatformSettingFilter(BaseFilterMixin): |
28 |
| - pass |
29 |
| - |
30 |
| - |
31 |
| -@strawberry_django.filter(Substitute, lookups=True) |
32 |
| -@autotype_decorator(SubstituteFilterSet) |
33 |
| -class SubstituteFilter(BaseFilterMixin): |
34 |
| - pass |
| 1 | +# TODO: After drop 4.2 support write all graphql filters |
| 2 | +# import strawberry_django |
| 3 | +# import strawberry |
| 4 | +# from strawberry.scalars import ID |
| 5 | +# from core.graphql.filter_mixins import BaseFilterMixin, BaseObjectTypeFilterMixin, ChangeLogFilterMixin |
| 6 | +# from typing import Annotated, TYPE_CHECKING |
| 7 | + |
| 8 | + |
| 9 | +# from netbox_config_diff.models import ConfigCompliance, ConfigurationRequest, PlatformSetting, Substitute |
| 10 | +# if TYPE_CHECKING: |
| 11 | +# from .enums import ConfigComplianceStatusEnum, ConfigurationRequestStatusEnum |
| 12 | +# from dcim.graphql.filters import DeviceFilter |
| 13 | + |
| 14 | +# @strawberry_django.filter_type(ConfigCompliance, lookups=True) |
| 15 | +# class ConfigComplianceFilter(BaseFilterMixin): |
| 16 | +# device = Annotated["DeviceFilter", strawberry.lazy("dcim.graphql.filters")] | None = ( |
| 17 | +# strawberry_django.filter_field() |
| 18 | +# ) |
| 19 | +# device_id: ID | None = strawberry_django.filter_field() |
| 20 | +# status: Annotated["ConfigComplianceStatusEnum", strawberry.lazy("dcim.graphql.enums")] | None = ( |
| 21 | +# strawberry_django.filter_field() |
| 22 | +# ) |
| 23 | +# diff: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 24 | +# error: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 25 | +# actual_config: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 26 | +# rendered_config: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 27 | +# missing: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 28 | +# extra: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 29 | +# patch: strawberry_django.FilterLookup[str] | None = strawberry_django.filter_field() |
| 30 | + |
| 31 | + |
| 32 | +# @strawberry_django.filter(ConfigurationRequest, lookups=True) |
| 33 | +# @autotype_decorator(ConfigurationRequestFilterSet) |
| 34 | +# class ConfigurationRequestFilter(BaseFilterMixin): |
| 35 | +# pass |
| 36 | + |
| 37 | + |
| 38 | +# @strawberry_django.filter(PlatformSetting, lookups=True) |
| 39 | +# @autotype_decorator(PlatformSettingFilterSet) |
| 40 | +# class PlatformSettingFilter(BaseFilterMixin): |
| 41 | +# pass |
| 42 | + |
| 43 | + |
| 44 | +# @strawberry_django.filter(Substitute, lookups=True) |
| 45 | +# @autotype_decorator(SubstituteFilterSet) |
| 46 | +# class SubstituteFilter(BaseFilterMixin): |
| 47 | +# pass |
0 commit comments