Explorar o código

Merge pull request #9483 from kkthxbye-code/fix-9480

Fixes #9480 - Make the Service and ServiceTemplate tables sortable by ports
Jeremy Stretch %!s(int64=3) %!d(string=hai) anos
pai
achega
7a7f7c5dec
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      netbox/ipam/tables/services.py

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

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