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

Optimisation chargement des locaux

This commit is contained in:
Gabriel Detraz 2019-08-07 00:08:19 +02:00
parent 84cab79d6f
commit 0794056d19

View file

@ -267,9 +267,9 @@ def index_physical_grouping(request):
.prefetch_related( .prefetch_related(
'switch_set__interface_set__domain__extension' 'switch_set__interface_set__domain__extension'
)) ))
building_list = Building.objects.all() building_list = Building.objects.all().select_related('dormitory')
dormitory_list = Dormitory.objects.all() dormitory_list = Dormitory.objects.all().prefetch_related('building_set')
switch_bay_list = SwitchBay.objects.select_related('building') switch_bay_list = SwitchBay.objects.select_related('building__dormitory').prefetch_related('switch_set__interface_set__domain')
stack_list = SortTable.sort( stack_list = SortTable.sort(
stack_list, stack_list,
request.GET.get('col'), request.GET.get('col'),