Commit 07eddfff authored by Gabriel Detraz's avatar Gabriel Detraz Committed by grizzly

Optimisation chargement des switchs

parent 29f00f21
...@@ -535,7 +535,8 @@ class SwitchPortView(generics.ListAPIView): ...@@ -535,7 +535,8 @@ class SwitchPortView(generics.ListAPIView):
"""Exposes the associations between hostname, mac address and IPv4 in """Exposes the associations between hostname, mac address and IPv4 in
order to build the DHCP lease files. order to build the DHCP lease files.
""" """
queryset = topologie.Switch.objects.all().prefetch_related('ports__custom_profile') queryset = topologie.Switch.objects.all().select_related("switchbay").select_related("model__constructor").prefetch_related("ports__custom_profile__vlan_tagged").prefetch_related("ports__custom_profile__vlan_untagged").prefetch_related("ports__machine_interface__domain__extension").prefetch_related("ports__room")
serializer_class = serializers.SwitchPortSerializer serializer_class = serializers.SwitchPortSerializer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment