mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Refactor tables modules
This commit is contained in:
44
netbox/wireless/tables/wirelesslink.py
Normal file
44
netbox/wireless/tables/wirelesslink.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import django_tables2 as tables
|
||||
|
||||
from netbox.tables import NetBoxTable, columns
|
||||
from wireless.models import *
|
||||
|
||||
__all__ = (
|
||||
'WirelessLinkTable',
|
||||
)
|
||||
|
||||
|
||||
class WirelessLinkTable(NetBoxTable):
|
||||
id = tables.Column(
|
||||
linkify=True,
|
||||
verbose_name='ID'
|
||||
)
|
||||
status = columns.ChoiceFieldColumn()
|
||||
device_a = tables.Column(
|
||||
accessor=tables.A('interface_a__device'),
|
||||
linkify=True
|
||||
)
|
||||
interface_a = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
device_b = tables.Column(
|
||||
accessor=tables.A('interface_b__device'),
|
||||
linkify=True
|
||||
)
|
||||
interface_b = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
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', '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',
|
||||
'description',
|
||||
)
|
Reference in New Issue
Block a user