mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
Always include the 'actions' column, if present
This commit is contained in:
parent
20b03e3b35
commit
8480909f50
@ -28,6 +28,7 @@ class BaseTable(tables.Table):
|
|||||||
# Apply custom column ordering
|
# Apply custom column ordering
|
||||||
if columns is not None:
|
if columns is not None:
|
||||||
pk = self.base_columns.pop('pk', None)
|
pk = self.base_columns.pop('pk', None)
|
||||||
|
actions = self.base_columns.pop('actions', None)
|
||||||
|
|
||||||
for name, column in self.base_columns.items():
|
for name, column in self.base_columns.items():
|
||||||
if name in columns:
|
if name in columns:
|
||||||
@ -36,10 +37,13 @@ class BaseTable(tables.Table):
|
|||||||
self.columns.hide(name)
|
self.columns.hide(name)
|
||||||
self.sequence = columns
|
self.sequence = columns
|
||||||
|
|
||||||
# Always include PK column, if defined on the table
|
# Always include PK and actions column, if defined on the table
|
||||||
if pk:
|
if pk:
|
||||||
self.base_columns['pk'] = pk
|
self.base_columns['pk'] = pk
|
||||||
self.sequence.insert(0, 'pk')
|
self.sequence.insert(0, 'pk')
|
||||||
|
if actions:
|
||||||
|
self.base_columns['actions'] = actions
|
||||||
|
self.sequence.append('actions')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def configurable_columns(self):
|
def configurable_columns(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user