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__ = (
|
||||
'TenantColumn',
|
||||
'TenantGroupColumn',
|
||||
'TenancyColumnsMixin',
|
||||
)
|
||||
|
||||
|
||||
@ -50,3 +51,7 @@ class TenantGroupColumn(tables.TemplateColumn):
|
||||
def value(self, value):
|
||||
return str(value) if value else None
|
||||
|
||||
|
||||
class TenancyColumnsMixin(tables.Table):
|
||||
tenant_group = TenantGroupColumn()
|
||||
tenant = TenantColumn()
|
||||
|
Reference in New Issue
Block a user