mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-10 22:02:17 -06:00
Adding asdot notation to ASN views
Adds custom property to asn model to compute asdot notation if required. Updates asn view to show asdot notation if one exists in the format xxxxx (yyy.yyy) Adds a custom column renderer to asn table to display asdot notation if one exists
This commit is contained in:
@@ -106,6 +106,13 @@ class ASNTable(BaseTable):
|
||||
asn = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
|
||||
def render_asn(self, value, record):
|
||||
if record.asdot_notation:
|
||||
return f'{value} ({record.asdot_notation})'
|
||||
else:
|
||||
return value
|
||||
|
||||
site_count = LinkedCountColumn(
|
||||
viewname='dcim:site_list',
|
||||
url_params={'asn_id': 'pk'},
|
||||
|
||||
Reference in New Issue
Block a user