mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Closes #2810: Include description fields in interface connections export
This commit is contained in:
parent
dc70fdbe03
commit
0256448dd8
@ -11,6 +11,7 @@ v2.5.4 (FUTURE)
|
||||
* [#2782](https://github.com/digitalocean/netbox/issues/2782) - Add `is_pool` field for prefix filtering
|
||||
* [#2807](https://github.com/digitalocean/netbox/issues/2807) - Include device site/rack assignment in cable trace view
|
||||
* [#2808](https://github.com/digitalocean/netbox/issues/2808) - Loosen version pinning for Django to allow patch releases
|
||||
* [#2810](https://github.com/digitalocean/netbox/issues/2810) - Include description fields in interface connections export
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
|
@ -1782,14 +1782,20 @@ class InterfaceConnectionsListView(ObjectListView):
|
||||
def queryset_to_csv(self):
|
||||
csv_data = [
|
||||
# Headers
|
||||
','.join(['device_a', 'interface_a', 'device_b', 'interface_b', 'connection_status'])
|
||||
','.join([
|
||||
'device_a', 'interface_a', 'interface_a_description',
|
||||
'device_b', 'interface_b', 'interface_b_description',
|
||||
'connection_status'
|
||||
])
|
||||
]
|
||||
for obj in self.queryset:
|
||||
csv = csv_format([
|
||||
obj.connected_endpoint.device.identifier if obj.connected_endpoint else None,
|
||||
obj.connected_endpoint.name if obj.connected_endpoint else None,
|
||||
obj.connected_endpoint.description if obj.connected_endpoint else None,
|
||||
obj.device.identifier,
|
||||
obj.name,
|
||||
obj.description,
|
||||
obj.get_connection_status_display(),
|
||||
])
|
||||
csv_data.append(csv)
|
||||
|
Loading…
Reference in New Issue
Block a user