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

Update connected_endpoint serializer field to support multiple objects

This commit is contained in:
jeremystretch
2022-05-13 11:04:38 -04:00
parent 3a461d0279
commit 4c51dbba80
5 changed files with 73 additions and 41 deletions

View File

@ -93,7 +93,7 @@ class PassThroughPortMixin(object):
Return all CablePaths which traverse a given pass-through port.
"""
obj = get_object_or_404(self.queryset, pk=pk)
cablepaths = CablePath.objects.filter(_nodes__contains=obj).prefetch_related('origin', 'destination')
cablepaths = CablePath.objects.filter(_nodes__contains=obj)
serializer = serializers.CablePathSerializer(cablepaths, context={'request': request}, many=True)
return Response(serializer.data)