This commit is contained in:
Arthur 2023-08-25 13:52:24 -07:00
parent 46b0df43f9
commit 36f57f8f08

View File

@ -5,6 +5,7 @@ from dcim.graphql.mixins import CabledObjectMixin
from extras.graphql.mixins import CustomFieldsMixin, TagsMixin, ContactsMixin
from netbox.graphql.types import ObjectType, OrganizationalObjectType, NetBoxObjectType
from .filters import *
from typing import List
__all__ = (
'CircuitTerminationType',
@ -16,13 +17,39 @@ __all__ = (
)
@strawberry.django.type(
models.Provider,
fields='__all__',
filters=ProviderFilter
)
class ProviderType(NetBoxObjectType, ContactsMixin):
pass
@strawberry.django.type(
models.ProviderAccount,
fields='__all__',
filters=ProviderAccountFilter
)
class ProviderAccountType(NetBoxObjectType):
pass
@strawberry.django.type(
models.ProviderNetwork,
fields='__all__',
filters=ProviderNetworkFilter
)
class ProviderNetworkType(NetBoxObjectType):
pass
@strawberry.django.type(
models.CircuitTermination,
fields='__all__',
filters=CircuitTerminationFilter
)
class CircuitTerminationType:
# class CircuitTerminationType(CustomFieldsMixin, TagsMixin, CabledObjectMixin, ObjectType):
class CircuitTerminationType(CustomFieldsMixin, TagsMixin, CabledObjectMixin, ObjectType):
pass
@ -32,8 +59,7 @@ class CircuitTerminationType:
filters=CircuitFilter
)
class CircuitType(NetBoxObjectType, ContactsMixin):
# class CircuitType(NetBoxObjectType, ContactsMixin):
pass
provider: ProviderType
@strawberry.django.type(
@ -41,36 +67,5 @@ class CircuitType(NetBoxObjectType, ContactsMixin):
fields='__all__',
filters=CircuitTypeFilter
)
class CircuitTypeType:
# class CircuitTypeType(OrganizationalObjectType):
pass
@strawberry.django.type(
models.Provider,
fields='__all__',
filters=ProviderFilter
)
class ProviderType:
# class ProviderType(NetBoxObjectType, ContactsMixin):
pass
@strawberry.django.type(
models.ProviderAccount,
fields='__all__',
filters=ProviderAccountFilter
)
class ProviderAccountType:
# class ProviderAccountType(NetBoxObjectType):
pass
@strawberry.django.type(
models.ProviderNetwork,
fields='__all__',
filters=ProviderNetworkFilter
)
class ProviderNetworkType:
# class ProviderNetworkType(NetBoxObjectType):
class CircuitTypeType(OrganizationalObjectType):
pass