1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Omit _path from CableTermination models

This commit is contained in:
jeremystretch
2021-06-30 10:20:20 -04:00
parent e6091ee0c9
commit 2fe734e6f9
2 changed files with 6 additions and 9 deletions

View File

@ -56,7 +56,7 @@ class ConsolePortType(TaggedObjectType):
class Meta:
model = models.ConsolePort
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.ConsolePortFilterSet
def resolve_type(self, info):
@ -78,7 +78,7 @@ class ConsoleServerPortType(TaggedObjectType):
class Meta:
model = models.ConsoleServerPort
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.ConsoleServerPortFilterSet
def resolve_type(self, info):
@ -162,7 +162,7 @@ class InterfaceType(TaggedObjectType):
class Meta:
model = models.Interface
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.InterfaceFilterSet
def resolve_mode(self, info):
@ -213,7 +213,7 @@ class PowerFeedType(TaggedObjectType):
class Meta:
model = models.PowerFeed
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.PowerFeedFilterSet
@ -221,7 +221,7 @@ class PowerOutletType(TaggedObjectType):
class Meta:
model = models.PowerOutlet
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.PowerOutletFilterSet
def resolve_feed_leg(self, info):
@ -257,7 +257,7 @@ class PowerPortType(TaggedObjectType):
class Meta:
model = models.PowerPort
fields = '__all__'
exclude = ('_path',)
filterset_class = filtersets.PowerPortFilterSet
def resolve_type(self, info):

View File

@ -446,9 +446,6 @@ class APIViewTestCases:
# Compile list of fields to include
fields_string = ''
for field_name, field in type_class._meta.fields.items():
# TODO: Omit "hidden" fields from GraphQL types
if field_name.startswith('_'):
continue
if type(field) is Dynamic:
# Dynamic fields must specify a subselection
fields_string += f'{field_name} {{ id }}\n'