mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
Join across the InstanceLink.target to the underlying Instance
to avoid having to do a lookup for every instance in the list for the mesh visualizer endpoint.
This commit is contained in:
committed by
Seth Foster
parent
7a1ed406da
commit
8c7c00451a
@@ -17,7 +17,7 @@ class MeshVisualizer(APIView):
|
|||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
data = {
|
data = {
|
||||||
'nodes': InstanceNodeSerializer(Instance.objects.all(), many=True).data,
|
'nodes': InstanceNodeSerializer(Instance.objects.all(), many=True).data,
|
||||||
'links': InstanceLinkSerializer(InstanceLink.objects.select_related('target', 'source'), many=True).data,
|
'links': InstanceLinkSerializer(InstanceLink.objects.select_related('target__instance', 'source'), many=True).data,
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user