Introduce TenantColumn to simplify representation

This commit is contained in:
Jeremy Stretch
2021-03-04 16:07:55 -05:00
parent 42af4e6564
commit 32b2693767
7 changed files with 48 additions and 77 deletions

View File

@@ -1,7 +1,7 @@
import django_tables2 as tables
from dcim.models import Region, Site
from tenancy.tables import COL_TENANT
from tenancy.tables import TenantColumn
from utilities.tables import BaseTable, ButtonsColumn, ChoiceFieldColumn, TagColumn, ToggleColumn
from .template_code import MPTT_LINK
@@ -46,9 +46,7 @@ class SiteTable(BaseTable):
region = tables.Column(
linkify=True
)
tenant = tables.TemplateColumn(
template_code=COL_TENANT
)
tenant = TenantColumn()
tags = TagColumn(
url_name='dcim:site_list'
)