From 08d9e04a9e38ff5b4eaa5c3ce0c016abb1264efb Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Wed, 7 Aug 2019 00:29:21 +0200 Subject: [PATCH] =?UTF-8?q?Optimisation=20affichage=20d=C3=A9taill=C3=A9?= =?UTF-8?q?=20d'un=20switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/topologie/views.py b/topologie/views.py index 01c21cfb..d3acdff2 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -186,16 +186,18 @@ def index_port(request, switch, switchid): """ Affichage de l'ensemble des ports reliés à un switch particulier""" port_list = (Port.objects .filter(switch=switch) - .select_related('room') + .select_related('room__building__dormitory') .select_related('machine_interface__domain__extension') .select_related('machine_interface__machine__user') - .select_related('related__switch') + .select_related('machine_interface__machine__accesspoint') + .select_related('related__switch__switchbay__building__dormitory') .prefetch_related(Prefetch( 'related__switch__interface_set', queryset=(Interface.objects .select_related('domain__extension')) )) - .select_related('switch')) + .select_related('switch__switchbay__building__dormitory') + .select_related('switch__model__constructor')) port_list = SortTable.sort( port_list, request.GET.get('col'),