Commit c6cbc766 by Kálmán Viktor

network: host list with less SQL queries

parent 328afa24
...@@ -276,10 +276,9 @@ class HostList(SingleTableView): ...@@ -276,10 +276,9 @@ class HostList(SingleTableView):
def get_table_data(self): def get_table_data(self):
vlan_id = self.request.GET.get('vlan') vlan_id = self.request.GET.get('vlan')
if vlan_id: if vlan_id:
data = Host.objects.filter(vlan=vlan_id).all() data = Host.objects.filter(vlan=vlan_id).select_related()
else: else:
data = Host.objects.all() data = Host.objects.select_related()
return data return data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment