feat: make site prefix column sortable

Clicking the Prefix column header sorts device and rack lists by site
name, which starts with the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 11:10:29 +02:00
co-authored by Claude Opus 5.5
parent 337cd28c23
commit c7b65f123b
3 changed files with 11 additions and 2 deletions
@@ -74,5 +74,9 @@ class SitePrefixTest(SimpleTestCase):
self.assertIn(COLUMN_NAME, DeviceTable.base_columns)
self.assertIn(COLUMN_NAME, RackTable.base_columns)
for table in (DeviceTable, RackTable):
column = table.base_columns[COLUMN_NAME]
self.assertTrue(column.orderable)
self.assertEqual(tuple(column.order_by), ("site__name",))
self.assertEqual(DeviceTable.Meta.default_columns[:2], ("pk", COLUMN_NAME))
self.assertEqual(RackTable.Meta.default_columns[:2], ("pk", COLUMN_NAME))