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

Moins de requêtes

This commit is contained in:
LEVY-FALK Hugo 2017-10-26 11:51:41 +02:00 committed by root
parent 1c8a3a87c0
commit da85cd9254

View file

@ -425,9 +425,9 @@ def create_ports(request, switch_id):
s_begin = s_end = 0 s_begin = s_end = 0
nb_ports = switch.ports.count() nb_ports = switch.ports.count()
if nb_ports > 0: if nb_ports > 0:
ports = switch.ports.order_by('port') ports = switch.ports.order_by('port').values('port')
s_begin = ports[0].port s_begin = ports.first().get('port')
s_end = ports.last().port s_end = ports.last().get('port')
port_form = CreatePortsForm( port_form = CreatePortsForm(
request.POST or None, request.POST or None,