From 99fd3031430b378990eb86ffb2af7cbd3f3310b6 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 6 Aug 2019 04:20:53 +0200 Subject: [PATCH] Optimisation chargement des profils de ports --- topologie/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/topologie/views.py b/topologie/views.py index 558666c6..59532b99 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -165,8 +165,10 @@ def index(request): @can_view_all(PortProfile) def index_port_profile(request): pagination_number = GeneralOption.get_cached_value('pagination_number') - port_profile_list = PortProfile.objects.all().select_related( - 'vlan_untagged') + port_profile_list = PortProfile.objects.all()\ + .select_related('vlan_untagged')\ + .select_related('on_dormitory')\ + .prefetch_related('vlan_tagged') port_profile_list = re2o_paginator( request, port_profile_list, pagination_number) vlan_list = Vlan.objects.all().order_by('vlan_id')