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

Closes #3064: Include tags in object lists as a toggleable table column

This commit is contained in:
Jeremy Stretch
2020-05-06 14:42:51 -04:00
parent fbc8b46d13
commit a4dbd2dae5
9 changed files with 126 additions and 34 deletions

View File

@ -1,6 +1,6 @@
import django_tables2 as tables
from utilities.tables import BaseTable, ToggleColumn
from utilities.tables import BaseTable, TagColumn, ToggleColumn
from .models import SecretRole, Secret
SECRETROLE_ACTIONS = """
@ -42,8 +42,11 @@ class SecretRoleTable(BaseTable):
class SecretTable(BaseTable):
pk = ToggleColumn()
device = tables.LinkColumn()
tags = TagColumn(
url_name='secrets:secret_list'
)
class Meta(BaseTable.Meta):
model = Secret
fields = ('pk', 'device', 'role', 'name', 'last_updated', 'hash')
fields = ('pk', 'device', 'role', 'name', 'last_updated', 'hash', 'tags')
default_columns = ('pk', 'device', 'role', 'name', 'last_updated')