mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 12:53:11 +00:00
Moins de requêtes
This commit is contained in:
parent
1c8a3a87c0
commit
da85cd9254
1 changed files with 3 additions and 3 deletions
|
@ -425,9 +425,9 @@ def create_ports(request, switch_id):
|
|||
s_begin = s_end = 0
|
||||
nb_ports = switch.ports.count()
|
||||
if nb_ports > 0:
|
||||
ports = switch.ports.order_by('port')
|
||||
s_begin = ports[0].port
|
||||
s_end = ports.last().port
|
||||
ports = switch.ports.order_by('port').values('port')
|
||||
s_begin = ports.first().get('port')
|
||||
s_end = ports.last().get('port')
|
||||
|
||||
port_form = CreatePortsForm(
|
||||
request.POST or None,
|
||||
|
|
Loading…
Reference in a new issue