Introduce TenantColumn to simplify representation

This commit is contained in:
Jeremy Stretch
2021-03-04 16:07:55 -05:00
parent 23b58ccbe8
commit 20a85c1ef2
7 changed files with 48 additions and 77 deletions
+2 -4
View File
@@ -1,7 +1,7 @@
import django_tables2 as tables
from dcim.tables.devices import BaseInterfaceTable
from tenancy.tables import COL_TENANT
from tenancy.tables import TenantColumn
from utilities.tables import (
BaseTable, ButtonsColumn, ChoiceFieldColumn, ColoredLabelColumn, LinkedCountColumn, TagColumn, ToggleColumn,
)
@@ -107,9 +107,7 @@ class VirtualMachineTable(BaseTable):
linkify=True
)
role = ColoredLabelColumn()
tenant = tables.TemplateColumn(
template_code=COL_TENANT
)
tenant = TenantColumn()
class Meta(BaseTable.Meta):
model = VirtualMachine