1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Initial support for table column reordering

This commit is contained in:
Jeremy Stretch
2020-04-27 16:56:25 -04:00
parent 4971054c34
commit 0ee1112d9d
3 changed files with 29 additions and 3 deletions

View File

@@ -164,7 +164,8 @@ class ObjectListView(View):
permissions[action] = request.user.has_perm(perm_name)
# Construct the table based on the user's permissions
table = self.table(self.queryset)
columns = request.user.config.get(f"tables.{self.table.__name__}.columns")
table = self.table(self.queryset, columns=columns)
if 'pk' in table.base_columns and (permissions['change'] or permissions['delete']):
table.columns.show('pk')