8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 20:03:11 +00:00

Optimisation affichage détaillé d'un switch

This commit is contained in:
Gabriel Detraz 2019-08-07 00:29:21 +02:00
parent 0794056d19
commit 08d9e04a9e

View file

@ -186,16 +186,18 @@ def index_port(request, switch, switchid):
""" Affichage de l'ensemble des ports reliés à un switch particulier""" """ Affichage de l'ensemble des ports reliés à un switch particulier"""
port_list = (Port.objects port_list = (Port.objects
.filter(switch=switch) .filter(switch=switch)
.select_related('room') .select_related('room__building__dormitory')
.select_related('machine_interface__domain__extension') .select_related('machine_interface__domain__extension')
.select_related('machine_interface__machine__user') .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( .prefetch_related(Prefetch(
'related__switch__interface_set', 'related__switch__interface_set',
queryset=(Interface.objects queryset=(Interface.objects
.select_related('domain__extension')) .select_related('domain__extension'))
)) ))
.select_related('switch')) .select_related('switch__switchbay__building__dormitory')
.select_related('switch__model__constructor'))
port_list = SortTable.sort( port_list = SortTable.sort(
port_list, port_list,
request.GET.get('col'), request.GET.get('col'),