Include asset_tag in module display name (and remove pk) #7050

Closed
opened 2025-12-29 19:48:20 +01:00 by adam · 4 comments
Owner

Originally created by @cpmills1975 on GitHub (Sep 29, 2022).

NetBox version

v3.3.4

Feature type

Change to existing functionality

Proposed functionality

Having started dabbling with adding modules to devices, I'd like to suggest a different display naming scheme for modules.

At present Module.str returns a combination of the module bay name, the module type and the module's pk. I'd suggest the pk means very little to the vast majority of NetBox users and should therefore be displayed only as a last option when all other means of identifying an instance have been exhausted.

I'd like to suggest the following:

  • Drop the module bay name completely

    Both the device interfaces table and the modules table allow the module bay name to be displayed if this is important to the viewer

    However, there is one place where the module bay name makes sense - when editing an interface and choosing to add the interface to a module. If multiple instances of a similar module exist, then without a user settable module name, it makes sense to include the module bay name.

  • Replace the pk with the asset_tag if present

    The pk means nothing to most people most of the time and because it is currently impossible to move a module, deleting and re-adding the module will mean a new pk anyway.

Use case

With line cards for most large network device types costing more than the chassis that houses it most companies would likely want to add an asset tag to a line card and, if that is present, it makes sense to include it in the display name. Similarly, the presence of the pk in the display name likely means nothing to most people.

Database changes

None

External dependencies

None

Originally created by @cpmills1975 on GitHub (Sep 29, 2022). ### NetBox version v3.3.4 ### Feature type Change to existing functionality ### Proposed functionality Having started dabbling with adding modules to devices, I'd like to suggest a different display naming scheme for modules. At present Module.__str__ returns a combination of the module bay name, the module type and the module's pk. I'd suggest the pk means very little to the vast majority of NetBox users and should therefore be displayed only as a last option when all other means of identifying an instance have been exhausted. I'd like to suggest the following: - Drop the module bay name completely Both the device interfaces table and the modules table allow the module bay name to be displayed if this is important to the viewer However, there is one place where the module bay name makes sense - when editing an interface and choosing to add the interface to a module. If multiple instances of a similar module exist, then without a user settable module name, it makes sense to include the module bay name. - Replace the pk with the asset_tag if present The pk means nothing to most people most of the time and because it is currently impossible to move a module, deleting and re-adding the module will mean a new pk anyway. ### Use case With line cards for most large network device types costing more than the chassis that houses it most companies would likely want to add an asset tag to a line card and, if that is present, it makes sense to include it in the display name. Similarly, the presence of the pk in the display name likely means nothing to most people. ### Database changes None ### External dependencies None
adam added the type: featurepending closurestatus: revisions needed labels 2025-12-29 19:48:20 +01:00
adam closed this issue 2025-12-29 19:48:20 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 3, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Dec 3, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Dec 27, 2022):

Where specifically are you proposing the format of the name be changed in the UI/API?

@jeremystretch commented on GitHub (Dec 27, 2022): Where specifically are you proposing the format of the name be changed in the UI/API?
Author
Owner

@github-actions[bot] commented on GitHub (Mar 28, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Mar 28, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Apr 27, 2023):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Apr 27, 2023): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7050