mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Table mixin for Tenancy columns
A mixin to add the Tenant and Tenant Group columns to a table.
This commit is contained in:
@ -3,6 +3,7 @@ import django_tables2 as tables
|
|||||||
__all__ = (
|
__all__ = (
|
||||||
'TenantColumn',
|
'TenantColumn',
|
||||||
'TenantGroupColumn',
|
'TenantGroupColumn',
|
||||||
|
'TenancyColumnsMixin',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -50,3 +51,7 @@ class TenantGroupColumn(tables.TemplateColumn):
|
|||||||
def value(self, value):
|
def value(self, value):
|
||||||
return str(value) if value else None
|
return str(value) if value else None
|
||||||
|
|
||||||
|
|
||||||
|
class TenancyColumnsMixin(tables.Table):
|
||||||
|
tenant_group = TenantGroupColumn()
|
||||||
|
tenant = TenantColumn()
|
||||||
|
Reference in New Issue
Block a user