Skip to content

Commit

Permalink
moving filter_lookups.py to netbox/graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypng committed Feb 12, 2025
1 parent e3e2e5d commit cfa8291
Show file tree
Hide file tree
Showing 17 changed files with 110 additions and 110 deletions.
2 changes: 1 addition & 1 deletion netbox/circuits/graphql/filter_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if TYPE_CHECKING:
from .filters import *
from core.graphql.filter_lookups import *
from netbox.graphql.filter_lookups import *
from netbox.graphql.enums import *

__all__ = ['BaseCircuitTypeFilterMixin']
Expand Down
8 changes: 4 additions & 4 deletions netbox/circuits/graphql/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .enums import *
from netbox.graphql.enums import *
from wireless.graphql.enums import *
from core.graphql.filter_lookups import *
from netbox.graphql.filter_lookups import *
from core.graphql.filters import *
from extras.graphql.filters import *
from circuits.graphql.filters import *
Expand Down Expand Up @@ -62,10 +62,10 @@ class CircuitTerminationFilter(
strawberry_django.filter_field()
)
termination_id: ID | None = strawberry_django.filter_field()
port_speed: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
port_speed: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
upstream_speed: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
upstream_speed: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
xconnect_id: FilterLookup[str] | None = strawberry_django.filter_field()
Expand Down Expand Up @@ -97,7 +97,7 @@ class CircuitFilter(ContactFilterMixin, ImageAttachmentFilterMixin, DistanceFilt
tenant_id: ID | None = strawberry_django.filter_field()
install_date: DateFilterLookup[date] | None = strawberry_django.filter_field()
termination_date: DateFilterLookup[date] | None = strawberry_django.filter_field()
commit_rate: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
commit_rate: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)

Expand Down
12 changes: 6 additions & 6 deletions netbox/core/graphql/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
)
from django.contrib.contenttypes.models import ContentType as DjangoContentType
from core.graphql.filter_mixins import BaseFilterMixin
from core.graphql.filter_lookups import JSONFilter
from netbox.graphql.filter_lookups import JSONFilter
from netbox.graphql.filter_mixins import (
PrimaryModelFilterMixin,
)

from core import models

if TYPE_CHECKING:
from core.graphql.filter_lookups import *
from netbox.graphql.filter_lookups import *
from users.graphql.filters import *


Expand All @@ -39,7 +39,7 @@ class DataFileFilter(BaseFilterMixin):
)
source_id: ID | None = strawberry_django.filter_field()
path: FilterLookup[str] | None = strawberry_django.filter_field()
size: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
size: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
hash: FilterLookup[str] | None = strawberry_django.filter_field()
Expand All @@ -53,7 +53,7 @@ class DataSourceFilter(PrimaryModelFilterMixin):
status: FilterLookup[str] | None = strawberry_django.filter_field()
enabled: FilterLookup[bool] | None = strawberry_django.filter_field()
ignore_rules: FilterLookup[str] | None = strawberry_django.filter_field()
parameters: Annotated['JSONFilter', strawberry.lazy('core.graphql.filter_lookups')] | None = (
parameters: Annotated['JSONFilter', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
last_synced: DatetimeFilterLookup[datetime] | None = strawberry_django.filter_field()
Expand All @@ -78,10 +78,10 @@ class ObjectChangeFilter(BaseFilterMixin):
related_object_type_id: ID | None = strawberry_django.filter_field()
related_object_id: ID | None = strawberry_django.filter_field()
object_repr: FilterLookup[str] | None = strawberry_django.filter_field()
prechange_data: Annotated['JSONFilter', strawberry.lazy('core.graphql.filter_lookups')] | None = (
prechange_data: Annotated['JSONFilter', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
postchange_data: Annotated['JSONFilter', strawberry.lazy('core.graphql.filter_lookups')] | None = (
postchange_data: Annotated['JSONFilter', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)

Expand Down
16 changes: 8 additions & 8 deletions netbox/dcim/graphql/filter_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

if TYPE_CHECKING:
from .filters import *
from core.graphql.filter_lookups import *
from netbox.graphql.filter_lookups import *
from extras.graphql.filters import *
from ipam.graphql.filters import *

Expand Down Expand Up @@ -81,7 +81,7 @@ class RenderConfigFilterMixin(BaseFilterMixin):
@dataclass
class InterfaceBaseFilterMixin(BaseFilterMixin):
enabled: FilterLookup[bool] | None = strawberry_django.filter_field()
mtu: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
mtu: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
mode: InterfaceModeEnum | None = strawberry_django.filter_field()
Expand Down Expand Up @@ -114,25 +114,25 @@ class InterfaceBaseFilterMixin(BaseFilterMixin):
@dataclass
class RackBaseFilterMixin(WeightFilterMixin, PrimaryModelFilterMixin):
width: Annotated['RackWidthEnum', strawberry.lazy('dcim.graphql.enums')] | None = strawberry_django.filter_field()
u_height: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
u_height: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
starting_unit: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
starting_unit: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
desc_units: FilterLookup[bool] | None = strawberry_django.filter_field()
outer_width: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
outer_width: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
outer_depth: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
outer_depth: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
outer_unit: Annotated['RackDimensionUnitEnum', strawberry.lazy('dcim.graphql.enums')] | None = (
strawberry_django.filter_field()
)
mounting_depth: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
mounting_depth: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
max_weight: Annotated['IntegerLookup', strawberry.lazy('core.graphql.filter_lookups')] | None = (
max_weight: Annotated['IntegerLookup', strawberry.lazy('netbox.graphql.filter_lookups')] | None = (
strawberry_django.filter_field()
)
Loading

0 comments on commit cfa8291

Please sign in to comment.