[PR #13974] [MERGED] Adds selection custom field labels to UI #14292

Closed
opened 2025-12-29 23:23:38 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13974
Author: @sleepinggenius2
Created: 10/4/2023
Status: Merged
Merged: 10/5/2023
Merged by: @jeremystretch

Base: developHead: issue_13950


📝 Commits (1)

  • 525dbfe Adds selection custom field labels to UI

📊 Changes

3 files changed (+14 additions, -1 deletions)

View changed files

📝 netbox/extras/models/customfields.py (+5 -0)
📝 netbox/netbox/tables/columns.py (+3 -1)
📝 netbox/utilities/templatetags/builtins/tags.py (+6 -0)

📄 Description

Fixes: #13950

Adds a function to the CustomField model to get the choice label for a given value, defaulting to the passed value if one cannot be found. Updates the customfield_value template tag to leverage the new function, as I could not find a way to call a function with an argument in the template without registering a new tag anyway. Updates the render function of the CustomFieldColumn class to leverage the new function, so that table columns are rendered properly. Please let me know if there is anywhere else in the UI where custom field values are rendered that I might have missed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13974 **Author:** [@sleepinggenius2](https://github.com/sleepinggenius2) **Created:** 10/4/2023 **Status:** ✅ Merged **Merged:** 10/5/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `issue_13950` --- ### 📝 Commits (1) - [`525dbfe`](https://github.com/netbox-community/netbox/commit/525dbfe7baa36391bd848e8f3fedf41a29027706) Adds selection custom field labels to UI ### 📊 Changes **3 files changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/models/customfields.py` (+5 -0) 📝 `netbox/netbox/tables/columns.py` (+3 -1) 📝 `netbox/utilities/templatetags/builtins/tags.py` (+6 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #13950 <!-- Please include a summary of the proposed changes below. --> Adds a function to the `CustomField` model to get the choice label for a given value, defaulting to the passed value if one cannot be found. Updates the `customfield_value` template tag to leverage the new function, as I could not find a way to call a function with an argument in the template without registering a new tag anyway. Updates the `render` function of the `CustomFieldColumn` class to leverage the new function, so that table columns are rendered properly. Please let me know if there is anywhere else in the UI where custom field values are rendered that I might have missed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:23:38 +01:00
adam closed this issue 2025-12-29 23:23:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14292