Sfoglia il codice sorgente

Make the Service and ServiceTemplate tables sortable by ports

kkthxbye-code 3 anni fa
parent
commit
bb2d21abdd
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      netbox/ipam/tables/services.py

+ 4 - 2
netbox/ipam/tables/services.py

@@ -14,7 +14,8 @@ class ServiceTemplateTable(NetBoxTable):
         linkify=True
         linkify=True
     )
     )
     ports = tables.Column(
     ports = tables.Column(
-        accessor=tables.A('port_list')
+        accessor=tables.A('port_list'),
+        order_by=tables.A('ports'),
     )
     )
     tags = columns.TagColumn(
     tags = columns.TagColumn(
         url_name='ipam:servicetemplate_list'
         url_name='ipam:servicetemplate_list'
@@ -35,7 +36,8 @@ class ServiceTable(NetBoxTable):
         order_by=('device', 'virtual_machine')
         order_by=('device', 'virtual_machine')
     )
     )
     ports = tables.Column(
     ports = tables.Column(
-        accessor=tables.A('port_list')
+        accessor=tables.A('port_list'),
+        order_by=tables.A('ports'),
     )
     )
     tags = columns.TagColumn(
     tags = columns.TagColumn(
         url_name='ipam:service_list'
         url_name='ipam:service_list'