7699 review changes

This commit is contained in:
Arthur Hanson 2024-10-25 15:41:46 -07:00
parent 277b175f9f
commit 62358f6ead
3 changed files with 14 additions and 2 deletions

View File

@ -25,4 +25,4 @@ The cluster's operational status.
### Scope
The [region](../dcim/region.md), [site](../dcim/site.md) or [location](../dcim/location.md) with which this cluster is associated.
The [region](../dcim/region.md), [site](../dcim/site.md), [site group](../dcim/sitegroup.md) or [location](../dcim/location.md) with which this cluster is associated.

View File

@ -461,6 +461,10 @@ class LocationType(VLANGroupsMixin, ImageAttachmentsMixin, ContactsMixin, Organi
devices: List[Annotated["DeviceType", strawberry.lazy('dcim.graphql.types')]]
children: List[Annotated["LocationType", strawberry.lazy('dcim.graphql.types')]]
@strawberry_django.field
def clusters(self) -> List[Annotated["ClusterType", strawberry.lazy('virtualization.graphql.types')]]:
return self._clusters.all()
@strawberry_django.type(
models.Manufacturer,
@ -704,6 +708,10 @@ class RegionType(VLANGroupsMixin, ContactsMixin, OrganizationalObjectType):
def parent(self) -> Annotated["RegionType", strawberry.lazy('dcim.graphql.types')] | None:
return self.parent
@strawberry_django.field
def clusters(self) -> List[Annotated["ClusterType", strawberry.lazy('virtualization.graphql.types')]]:
return self._clusters.all()
@strawberry_django.type(
models.Site,
@ -748,6 +756,10 @@ class SiteGroupType(VLANGroupsMixin, ContactsMixin, OrganizationalObjectType):
def parent(self) -> Annotated["SiteGroupType", strawberry.lazy('dcim.graphql.types')] | None:
return self.parent
@strawberry_django.field
def clusters(self) -> List[Annotated["ClusterType", strawberry.lazy('virtualization.graphql.types')]]:
return self._clusters.all()
@strawberry_django.type(
models.VirtualChassis,

View File

@ -1,4 +1,4 @@
# models values for ContentTypes which may be CircuitTermination scope types
# models values for ContentTypes which may be Cluster scope types
CLUSTER_SCOPE_TYPES = (
'region', 'sitegroup', 'site', 'location',
)