From 9c2514fce4d8d6c46fddae8e79afe66631b468ae Mon Sep 17 00:00:00 2001 From: Nico Domino Date: Mon, 8 Nov 2021 14:15:26 +0100 Subject: [PATCH] feat: add outer_width to RackTable (#7766) * feat: add outer_width to RackTable * fix: add outer_units to column display * feat: add outer_depth to available columns --- netbox/dcim/tables/racks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/tables/racks.py b/netbox/dcim/tables/racks.py index f3d1cb7f8..982e2a47f 100644 --- a/netbox/dcim/tables/racks.py +++ b/netbox/dcim/tables/racks.py @@ -72,12 +72,20 @@ class RackTable(BaseTable): tags = TagColumn( url_name='dcim:rack_list' ) + outer_width = tables.TemplateColumn( + template_code="{{ record.outer_width }} {{ record.outer_unit }}", + verbose_name='Outer Width' + ) + outer_depth = tables.TemplateColumn( + template_code="{{ record.outer_depth }} {{ record.outer_unit }}", + verbose_name='Outer Depth' + ) class Meta(BaseTable.Meta): model = Rack fields = ( 'pk', 'id', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'serial', 'asset_tag', 'type', - 'width', 'u_height', 'comments', 'device_count', 'get_utilization', 'get_power_utilization', 'tags', + 'width', 'outer_width', 'outer_depth', 'u_height', 'comments', 'device_count', 'get_utilization', 'get_power_utilization', 'tags', ) default_columns = ( 'pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'u_height', 'device_count',