15106 Add Length Field to Wireless Link (#16528)

* 15106 add wireles link length

* 15106 add wireles link length

* 15106 add wireless link length

* 15106 add tests

* 15106 rename length -> distance

* 15106 rename length -> distance

* 15106 review comments

* 15106 review comments

* 15106 fix form

* 15106 length -> distance
This commit is contained in:
Arthur Hanson
2024-06-17 06:19:49 -07:00
committed by GitHub
parent e12edd7420
commit 91dcecbd07
19 changed files with 168 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import django_tables2 as tables
from netbox.tables import NetBoxTable, columns
from tenancy.tables import TenancyColumnsMixin
from wireless.models import *
from .template_code import WIRELESS_LINK_DISTANCE
__all__ = (
'WirelessLinkTable',
@@ -36,6 +37,10 @@ class WirelessLinkTable(TenancyColumnsMixin, NetBoxTable):
verbose_name=_('Interface B'),
linkify=True
)
distance = columns.TemplateColumn(
template_code=WIRELESS_LINK_DISTANCE,
order_by=('_abs_distance')
)
tags = columns.TagColumn(
url_name='wireless:wirelesslink_list'
)
@@ -44,7 +49,8 @@ class WirelessLinkTable(TenancyColumnsMixin, NetBoxTable):
model = WirelessLink
fields = (
'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',
'tenant_group', 'distance', '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',