Skip to content

Commit

Permalink
Closes #2810: Include description fields in interface connections export
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jan 29, 2019
1 parent dc70fdb commit 0256448
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion netbox/dcim/views.py
Expand Up @@ -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)
Expand Down

0 comments on commit 0256448

Please sign in to comment.