10595 cable a_terminations to graphql

This commit is contained in:
Arthur 2022-10-06 13:27:21 -07:00
parent 664d5db5eb
commit fd7ad58fa0

View File

@ -86,7 +86,17 @@ class ComponentTemplateObjectType(
# Model types
#
class CableTerminationType(NetBoxObjectType):
class Meta:
model = models.CableTermination
fields = '__all__'
filterset_class = filtersets.CableTerminationFilterSet
class CableType(NetBoxObjectType):
a_terminations = graphene.List(CableTerminationType)
b_terminations = graphene.List(CableTerminationType)
class Meta:
model = models.Cable
@ -99,13 +109,11 @@ class CableType(NetBoxObjectType):
def resolve_length_unit(self, info):
return self.length_unit or None
def resolve_a_terminations(self, info):
return self.a_terminations
class CableTerminationType(NetBoxObjectType):
class Meta:
model = models.CableTermination
fields = '__all__'
filterset_class = filtersets.CableTerminationFilterSet
def resolve_b_terminations(self, info):
return self.b_terminations
class ConsolePortType(ComponentObjectType, CabledObjectMixin):