Skip to content

Commit

Permalink
#9177: Use TenancyColumnsMixin (from #9686)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 11, 2022
1 parent 123e758 commit 8a8ada8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions netbox/wireless/tables/wirelesslan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dcim.models import Interface
from netbox.tables import NetBoxTable, columns
from tenancy.tables import TenantColumn
from tenancy.tables import TenancyColumnsMixin
from wireless.models import *

__all__ = (
Expand Down Expand Up @@ -33,14 +33,13 @@ class Meta(NetBoxTable.Meta):
default_columns = ('pk', 'name', 'wirelesslan_count', 'description')


class WirelessLANTable(NetBoxTable):
class WirelessLANTable(TenancyColumnsMixin, NetBoxTable):
ssid = tables.Column(
linkify=True
)
group = tables.Column(
linkify=True
)
tenant = TenantColumn()
interface_count = tables.Column(
verbose_name='Interfaces'
)
Expand All @@ -51,8 +50,8 @@ class WirelessLANTable(NetBoxTable):
class Meta(NetBoxTable.Meta):
model = WirelessLAN
fields = (
'pk', 'ssid', 'group', 'tenant', 'description', 'vlan', 'interface_count', 'auth_type', 'auth_cipher',
'auth_psk', 'tags', 'created', 'last_updated',
'pk', 'ssid', 'group', 'tenant', 'tenant_group', 'description', 'vlan', 'interface_count', 'auth_type',
'auth_cipher', 'auth_psk', 'tags', 'created', 'last_updated',
)
default_columns = ('pk', 'ssid', 'group', 'description', 'vlan', 'auth_type', 'interface_count')

Expand Down
9 changes: 4 additions & 5 deletions netbox/wireless/tables/wirelesslink.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import django_tables2 as tables

from netbox.tables import NetBoxTable, columns
from tenancy.tables import TenantColumn
from tenancy.tables import TenancyColumnsMixin
from wireless.models import *

__all__ = (
'WirelessLinkTable',
)


class WirelessLinkTable(NetBoxTable):
class WirelessLinkTable(TenancyColumnsMixin, NetBoxTable):
id = tables.Column(
linkify=True,
verbose_name='ID'
Expand All @@ -29,16 +29,15 @@ class WirelessLinkTable(NetBoxTable):
interface_b = tables.Column(
linkify=True
)
tenant = TenantColumn()
tags = columns.TagColumn(
url_name='wireless:wirelesslink_list'
)

class Meta(NetBoxTable.Meta):
model = WirelessLink
fields = (
'pk', 'id', 'status', 'device_a', 'interface_a', 'device_b', 'interface_b', 'ssid', 'tenant', 'description',
'auth_type', 'auth_cipher', 'auth_psk', 'tags', 'created', 'last_updated',
'pk', 'id', 'status', 'device_a', 'interface_a', 'device_b', 'interface_b', 'ssid', 'tenant',
'tenant_group', 'description', 'auth_type', 'auth_cipher', 'auth_psk', 'tags', 'created', 'last_updated',
)
default_columns = (
'pk', 'id', 'status', 'device_a', 'interface_a', 'device_b', 'interface_b', 'ssid', 'auth_type',
Expand Down

0 comments on commit 8a8ada8

Please # to comment.