fix circular import

This commit is contained in:
inexcode 2022-08-13 02:18:13 +04:00
parent 9abc11f187
commit f750056ad8
3 changed files with 9 additions and 12 deletions

View file

@ -4,15 +4,21 @@ import strawberry
from selfprivacy_api.graphql.common_types.dns import DnsRecord
from selfprivacy_api.graphql.common_types.storage_usage import (
ServiceStorageUsage,
StorageUsageInterface,
StorageVolume,
)
from selfprivacy_api.graphql.queries.services import get_volume_by_id
from selfprivacy_api.services import get_service_by_id, get_services_by_location
from selfprivacy_api.services import Service as ServiceInterface
from selfprivacy_api.utils.block_devices import BlockDevices
@strawberry.type
class ServiceStorageUsage(StorageUsageInterface):
"""Storage usage for a service"""
service: typing.Optional["Service"]
@strawberry.enum
class ServiceStatusEnum(Enum):
RUNNING = "RUNNING"

View file

@ -1,8 +1,6 @@
import typing
import strawberry
from selfprivacy_api.graphql.common_types.service import Service
@strawberry.type
class StorageVolume:
@ -24,10 +22,3 @@ class StorageUsageInterface:
used_space: str
volume: typing.Optional[StorageVolume]
title: str
@strawberry.type
class ServiceStorageUsage(StorageUsageInterface):
"""Storage usage for a service"""
service: typing.Optional["Service"]

View file

@ -3,11 +3,11 @@
import typing
import strawberry
from selfprivacy_api.graphql.common_types.service import (
ServiceStorageUsage,
service_to_graphql_service,
get_volume_by_id,
)
from selfprivacy_api.graphql.common_types.storage_usage import (
ServiceStorageUsage,
StorageVolume,
)
from selfprivacy_api.services import get_services_by_location