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

Optimisation chargement des modules switchs

This commit is contained in:
Gabriel Detraz 2019-08-06 04:30:04 +02:00 committed by root
parent 99fd303143
commit 5034c2656c

View file

@ -339,7 +339,8 @@ def index_model_switch(request):
def index_module(request): def index_module(request):
"""Display all modules of switchs""" """Display all modules of switchs"""
module_list = ModuleSwitch.objects.all() module_list = ModuleSwitch.objects.all()
modular_switchs = Switch.objects.filter(model__is_modular=True) modular_switchs = Switch.objects.filter(model__is_modular=True)\
.select_related('model').prefetch_related('moduleonswitch_set__module')
pagination_number = GeneralOption.get_cached_value('pagination_number') pagination_number = GeneralOption.get_cached_value('pagination_number')
module_list = re2o_paginator(request, module_list, pagination_number) module_list = re2o_paginator(request, module_list, pagination_number)
return render( return render(