Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #13033: add formatted speed column to Interfaces #13275

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

matejv
Copy link
Contributor

@matejv matejv commented Jul 26, 2023

Fixes: #13033

Adds a new column to Interface table where interface speed is passed through humanize_speed & placeholder filters. I've opted to have placeholder filter, since almost all other InterfaceTable columns have it.

To keep CSV export looking OK I had to sub-class TemplateColumn and override value() method. This way we can keep formatted values in CSV exports (it didn't make sense to me to have un-formatted value, since we're keeping the original speed column). And have empty values in CSV export be empty and not filled with — placeholders.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! With a couple changes I think we can simplify it a bit.

netbox/dcim/tables/columns.py Outdated Show resolved Hide resolved
netbox/dcim/tables/columns.py Outdated Show resolved Hide resolved
@jeremystretch
Copy link
Member

Thanks @matejv!

@jeremystretch jeremystretch merged commit a807cca into netbox-community:develop Aug 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add formatted speed column to interface lists
2 participants