From 3fd2f8c67ff908894da6f7ee94b6b1e8f7836667 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 21 May 2024 13:16:27 -0700 Subject: [PATCH] 14653 add inventory_items to base class --- netbox/dcim/tables/devices.py | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index 036c13993..4925fb517 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -313,6 +313,10 @@ class ModularDeviceComponentTable(DeviceComponentTable): verbose_name=_('Module'), linkify=True ) + inventory_items = columns.ManyToManyColumn( + linkify_item=True, + verbose_name=_('Inventory Items'), + ) class CableTerminationTable(NetBoxTable): @@ -358,10 +362,6 @@ class ConsolePortTable(ModularDeviceComponentTable, PathEndpointTable): 'args': [Accessor('device_id')], } ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:consoleport_list' ) @@ -406,10 +406,6 @@ class ConsoleServerPortTable(ModularDeviceComponentTable, PathEndpointTable): 'args': [Accessor('device_id')], } ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:consoleserverport_list' ) @@ -461,10 +457,6 @@ class PowerPortTable(ModularDeviceComponentTable, PathEndpointTable): allocated_draw = tables.Column( verbose_name=_('Allocated draw (W)') ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:powerport_list' ) @@ -517,10 +509,6 @@ class PowerOutletTable(ModularDeviceComponentTable, PathEndpointTable): verbose_name=_('Power Port'), linkify=True ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:poweroutlet_list' ) @@ -634,10 +622,6 @@ class InterfaceTable(ModularDeviceComponentTable, BaseInterfaceTable, PathEndpoi verbose_name=_('VRF'), linkify=True ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:interface_list' ) @@ -721,10 +705,6 @@ class FrontPortTable(ModularDeviceComponentTable, CableTerminationTable): verbose_name=_('Rear Port'), linkify=True ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:frontport_list' ) @@ -778,10 +758,6 @@ class RearPortTable(ModularDeviceComponentTable, CableTerminationTable): color = columns.ColorColumn( verbose_name=_('Color'), ) - inventory_items = columns.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:rearport_list' )