mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 16:26:09 -06:00
10595 cable a_terminations to graphql
This commit is contained in:
parent
664d5db5eb
commit
fd7ad58fa0
@ -86,7 +86,17 @@ class ComponentTemplateObjectType(
|
|||||||
# Model types
|
# Model types
|
||||||
#
|
#
|
||||||
|
|
||||||
|
class CableTerminationType(NetBoxObjectType):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = models.CableTermination
|
||||||
|
fields = '__all__'
|
||||||
|
filterset_class = filtersets.CableTerminationFilterSet
|
||||||
|
|
||||||
|
|
||||||
class CableType(NetBoxObjectType):
|
class CableType(NetBoxObjectType):
|
||||||
|
a_terminations = graphene.List(CableTerminationType)
|
||||||
|
b_terminations = graphene.List(CableTerminationType)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Cable
|
model = models.Cable
|
||||||
@ -99,13 +109,11 @@ class CableType(NetBoxObjectType):
|
|||||||
def resolve_length_unit(self, info):
|
def resolve_length_unit(self, info):
|
||||||
return self.length_unit or None
|
return self.length_unit or None
|
||||||
|
|
||||||
|
def resolve_a_terminations(self, info):
|
||||||
|
return self.a_terminations
|
||||||
|
|
||||||
class CableTerminationType(NetBoxObjectType):
|
def resolve_b_terminations(self, info):
|
||||||
|
return self.b_terminations
|
||||||
class Meta:
|
|
||||||
model = models.CableTermination
|
|
||||||
fields = '__all__'
|
|
||||||
filterset_class = filtersets.CableTerminationFilterSet
|
|
||||||
|
|
||||||
|
|
||||||
class ConsolePortType(ComponentObjectType, CabledObjectMixin):
|
class ConsolePortType(ComponentObjectType, CabledObjectMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user