From 4d97043e268b29ef7ddfea848b8e768949896a9f Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 14 Sep 2022 15:50:45 -0700 Subject: [PATCH 1/2] #10359 add region column to site table --- netbox/dcim/tables/devices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index c42731b90..a7cdf4b9f 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -203,7 +203,7 @@ class DeviceTable(TenancyColumnsMixin, NetBoxTable): model = Device fields = ( 'pk', 'id', 'name', 'status', 'tenant', 'tenant_group', 'device_role', 'manufacturer', 'device_type', - 'platform', 'serial', 'asset_tag', 'site', 'location', 'rack', 'position', 'face', 'primary_ip', 'airflow', + 'platform', 'serial', 'asset_tag', 'site', 'region', 'location', 'rack', 'position', 'face', 'primary_ip', 'airflow', 'primary_ip4', 'primary_ip6', 'cluster', 'virtual_chassis', 'vc_position', 'vc_priority', 'comments', 'contacts', 'tags', 'created', 'last_updated', ) From e9a91455e8827fffaab7f10e9938bce3022b9ba3 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 15 Sep 2022 12:55:21 -0400 Subject: [PATCH 2/2] #10359: Add region and site group columns to the devices table --- docs/release-notes/version-3.3.md | 1 + netbox/dcim/tables/devices.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/version-3.3.md b/docs/release-notes/version-3.3.md index c5ca3d5be..6c7d5d291 100644 --- a/docs/release-notes/version-3.3.md +++ b/docs/release-notes/version-3.3.md @@ -7,6 +7,7 @@ * [#8580](https://github.com/netbox-community/netbox/issues/8580) - Add `occupied` filter for cabled objects to filter by cable or `mark_connected` * [#9577](https://github.com/netbox-community/netbox/issues/9577) - Add `has_front_image` and `has_rear_image` filters for device types * [#10268](https://github.com/netbox-community/netbox/issues/10268) - Omit trailing ".0" in device positions within UI +* [#10359](https://github.com/netbox-community/netbox/issues/10359) - Add region and site group columns to the devices table ### Bug Fixes diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index a7cdf4b9f..142c7ef67 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -143,6 +143,15 @@ class DeviceTable(TenancyColumnsMixin, NetBoxTable): template_code=DEVICE_LINK ) status = columns.ChoiceFieldColumn() + region = tables.Column( + accessor=Accessor('site__region'), + linkify=True + ) + site_group = tables.Column( + accessor=Accessor('site__group'), + linkify=True, + verbose_name='Site Group' + ) site = tables.Column( linkify=True ) @@ -203,9 +212,9 @@ class DeviceTable(TenancyColumnsMixin, NetBoxTable): model = Device fields = ( 'pk', 'id', 'name', 'status', 'tenant', 'tenant_group', 'device_role', 'manufacturer', 'device_type', - 'platform', 'serial', 'asset_tag', 'site', 'region', 'location', 'rack', 'position', 'face', 'primary_ip', 'airflow', - 'primary_ip4', 'primary_ip6', 'cluster', 'virtual_chassis', 'vc_position', 'vc_priority', 'comments', - 'contacts', 'tags', 'created', 'last_updated', + 'platform', 'serial', 'asset_tag', 'region', 'site_group', 'site', 'location', 'rack', 'position', 'face', + 'airflow', 'primary_ip', 'primary_ip4', 'primary_ip6', 'cluster', 'virtual_chassis', 'vc_position', + 'vc_priority', 'comments', 'contacts', 'tags', 'created', 'last_updated', ) default_columns = ( 'pk', 'name', 'status', 'tenant', 'site', 'location', 'rack', 'device_role', 'manufacturer', 'device_type',