8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-02 01:22:25 +00:00

Optimisation chargement des switchs

This commit is contained in:
Gabriel Detraz 2018-07-08 23:39:15 +02:00 committed by Alexandre Iooss
parent 5ca5d9176e
commit 2143393f59

View file

@ -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