From bc22b1530ba02a955cc4b6c56337939e963be1d4 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Wed, 4 Feb 2026 11:12:34 -0500 Subject: [PATCH] Use ManyToManyColumn --- netbox/dcim/tables/devices.py | 6 +++--- netbox/dcim/tables/template_code.py | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index f5eabdec0..08cfbc92f 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -585,12 +585,12 @@ class BaseInterfaceTable(NetBoxTable): verbose_name=_('IP Addresses') ) primary_mac_address = tables.Column( - verbose_name=_('MAC Address'), + verbose_name=_('Primary MAC'), linkify=True ) - mac_addresses = tables.TemplateColumn( - template_code=INTERFACE_MACADDRESSES, + mac_addresses = columns.ManyToManyColumn( orderable=False, + linkify_item=True, verbose_name=_('MAC Addresses') ) fhrp_groups = tables.TemplateColumn( diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index 12b192d83..3675a18cc 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -80,16 +80,6 @@ INTERFACE_IPADDRESSES = """ {% endif %} """ -INTERFACE_MACADDRESSES = """ - {% if value.count > 3 %} - {{ value.count }} - {% else %} - {% for mac in value.all %} - {{ mac }} - {% endfor %} - {% endif %} -""" - INTERFACE_FHRPGROUPS = """ {% for assignment in value.all %} {{ assignment.group }}