mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
18245 graphql
This commit is contained in:
parent
7c8862cb1e
commit
f362522590
@ -53,6 +53,7 @@ __all__ = (
|
||||
'DeviceBayFilter',
|
||||
'DeviceBayTemplateFilter',
|
||||
'DeviceRoleFilter',
|
||||
'DeviceRoleGroupFilter',
|
||||
'DeviceTypeFilter',
|
||||
'FrontPortFilter',
|
||||
'FrontPortTemplateFilter',
|
||||
@ -309,6 +310,20 @@ class DeviceRoleFilter(OrganizationalModelFilterMixin, RenderConfigFilterMixin):
|
||||
vm_role: FilterLookup[bool] | None = strawberry_django.filter_field()
|
||||
|
||||
|
||||
@strawberry_django.filter(models.DeviceRoleGroup, lookups=True)
|
||||
class DeviceRoleGroupFilter(OrganizationalModelFilterMixin):
|
||||
parent: Annotated['DeviceRoleGroupFilter', strawberry.lazy('dcim.graphql.filters')] | None = (
|
||||
strawberry_django.filter_field()
|
||||
)
|
||||
parent_id: ID | None = strawberry.UNSET
|
||||
roles: Annotated['DeviceRoleFilter', strawberry.lazy('dcim.graphql.filters')] | None = (
|
||||
strawberry_django.filter_field()
|
||||
)
|
||||
children: Annotated['DeviceRoleGroupFilter', strawberry.lazy('dcim.graphql.filters'), True] | None = (
|
||||
strawberry_django.filter_field()
|
||||
)
|
||||
|
||||
|
||||
@strawberry_django.filter(models.DeviceType, lookups=True)
|
||||
class DeviceTypeFilter(ImageAttachmentFilterMixin, PrimaryModelFilterMixin, WeightFilterMixin):
|
||||
manufacturer: Annotated['ManufacturerFilter', strawberry.lazy('dcim.graphql.filters')] | None = (
|
||||
|
@ -35,6 +35,9 @@ class DCIMQuery:
|
||||
device_role: DeviceRoleType = strawberry_django.field()
|
||||
device_role_list: List[DeviceRoleType] = strawberry_django.field()
|
||||
|
||||
device_role_group: DeviceRoleGroupType = strawberry_django.field()
|
||||
device_role_group_list: List[DeviceRoleGroupType] = strawberry_django.field()
|
||||
|
||||
device_type: DeviceTypeType = strawberry_django.field()
|
||||
device_type_list: List[DeviceTypeType] = strawberry_django.field()
|
||||
|
||||
|
@ -46,6 +46,7 @@ __all__ = (
|
||||
'DeviceBayType',
|
||||
'DeviceBayTemplateType',
|
||||
'DeviceRoleType',
|
||||
'DeviceRoleGroupType',
|
||||
'DeviceTypeType',
|
||||
'FrontPortType',
|
||||
'FrontPortTemplateType',
|
||||
@ -334,6 +335,14 @@ class DeviceRoleType(OrganizationalObjectType):
|
||||
devices: List[Annotated["DeviceType", strawberry.lazy('dcim.graphql.types')]]
|
||||
|
||||
|
||||
@strawberry_django.type(models.DeviceRoleGroup, fields='__all__', filters=DeviceRoleGroupFilter)
|
||||
class DeviceRoleGroupType(OrganizationalObjectType):
|
||||
parent: Annotated['DeviceRoleGroupType', strawberry.lazy('dcim.graphql.types')] | None
|
||||
|
||||
roles: List[DeviceRoleType]
|
||||
children: List[Annotated['DeviceRoleGroupType', strawberry.lazy('dcim.graphql.types')]]
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
models.DeviceType,
|
||||
fields='__all__',
|
||||
|
Loading…
Reference in New Issue
Block a user