[PR #19236] [MERGED] Fixes #19224: Fix GraphQL API support for custom field choices #15574

Closed
opened 2025-12-30 00:22:48 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19236
Author: @jeremystretch
Created: 4/17/2025
Status: Merged
Merged: 4/22/2025
Merged by: @bctiemann

Base: featureHead: 19224-graphql-choices


📝 Commits (1)

  • 4455c2c Fixes #19224: Fix GraphQL API support for custom field choices

📊 Changes

11 files changed (+82 additions, -81 deletions)

View changed files

📝 netbox/circuits/graphql/enums.py (+4 -8)
📝 netbox/dcim/graphql/enums.py (+31 -33)
📝 netbox/extras/graphql/enums.py (+3 -3)
📝 netbox/ipam/graphql/enums.py (+10 -10)
📝 netbox/netbox/graphql/enums.py (+1 -1)
📝 netbox/tenancy/graphql/enums.py (+1 -1)
📝 netbox/utilities/choices.py (+5 -9)
📝 netbox/utilities/string.py (+11 -0)
📝 netbox/virtualization/graphql/enums.py (+2 -2)
📝 netbox/vpn/graphql/enums.py (+9 -9)
📝 netbox/wireless/graphql/enums.py (+5 -5)

📄 Description

Fixes: #19224

Alter the as_enum() method on ChoiceSet to construct enum keys from the values, rather than the constants defined as attributes on the class. It also now accepts a prefix to prepend to keys.


🔄 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/19236 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 4/17/2025 **Status:** ✅ Merged **Merged:** 4/22/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `feature` ← **Head:** `19224-graphql-choices` --- ### 📝 Commits (1) - [`4455c2c`](https://github.com/netbox-community/netbox/commit/4455c2c7dc862f7c484a17e5bd4a95ce4b8ebb1e) Fixes #19224: Fix GraphQL API support for custom field choices ### 📊 Changes **11 files changed** (+82 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/graphql/enums.py` (+4 -8) 📝 `netbox/dcim/graphql/enums.py` (+31 -33) 📝 `netbox/extras/graphql/enums.py` (+3 -3) 📝 `netbox/ipam/graphql/enums.py` (+10 -10) 📝 `netbox/netbox/graphql/enums.py` (+1 -1) 📝 `netbox/tenancy/graphql/enums.py` (+1 -1) 📝 `netbox/utilities/choices.py` (+5 -9) 📝 `netbox/utilities/string.py` (+11 -0) 📝 `netbox/virtualization/graphql/enums.py` (+2 -2) 📝 `netbox/vpn/graphql/enums.py` (+9 -9) 📝 `netbox/wireless/graphql/enums.py` (+5 -5) </details> ### 📄 Description ### Fixes: #19224 Alter the `as_enum()` method on ChoiceSet to construct enum keys from the values, rather than the constants defined as attributes on the class. It also now accepts a `prefix` to prepend to keys. --- <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-30 00:22:48 +01:00
adam closed this issue 2025-12-30 00:22:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15574