[PR #4128] [MERGED] Closes #4108: Extraneous queryset evaluation by FilterChoiceFields #12765

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4128
Author: @jeremystretch
Created: 2/10/2020
Status: Merged
Merged: 2/10/2020
Merged by: @jeremystretch

Base: developHead: 4108-apiselect-performance


📝 Commits (6)

📊 Changes

9 files changed (+27 additions, -82 deletions)

View changed files

📝 docs/release-notes/version-2.7.md (+1 -0)
📝 netbox/circuits/forms.py (+1 -1)
📝 netbox/dcim/forms.py (+1 -13)
📝 netbox/extras/forms.py (+5 -2)
📝 netbox/ipam/forms.py (+0 -8)
📝 netbox/tenancy/forms.py (+0 -3)
📝 netbox/utilities/forms.py (+19 -39)
netbox/utilities/templates/widgets/select_api.html (+0 -9)
📝 netbox/virtualization/forms.py (+0 -7)

📄 Description

Fixes: #4108

Improve FilterChoiceField so that it no longer forces the evaluation of available choices on page load. (Choices are populated on-demand via the APISelect widget.)


🔄 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/4128 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/10/2020 **Status:** ✅ Merged **Merged:** 2/10/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `4108-apiselect-performance` --- ### 📝 Commits (6) - [`885ea8a`](https://github.com/netbox-community/netbox/commit/885ea8a4d5f7191afd564501e3b013b1c9ff85f6) Override get_bound_field() on FilterChoiceFieldMixin to restrict the queryset of bound fields - [`5ddfde2`](https://github.com/netbox-community/netbox/commit/5ddfde2214f535239652fd6ab3ef00f7436a24a9) Clean up unneeded code relevant to FilterChoiceField - [`55f5ede`](https://github.com/netbox-community/netbox/commit/55f5ede9708d23b5daaa79d687efde19929b3569) Standardize usage of FilterChoiceField - [`009fc4f`](https://github.com/netbox-community/netbox/commit/009fc4f301e9a74016b03ecbaea6e9095c8f6f9c) Remove custom template for APISelect widget - [`5008526`](https://github.com/netbox-community/netbox/commit/5008526db145059f66031f2e7b0fc6180327ed22) Set a default self.to_field_name for FilterChoiceField - [`d4789b7`](https://github.com/netbox-community/netbox/commit/d4789b7c9e14ed5b180230c0511774c4c8c01de2) Changelog for #4108 ### 📊 Changes **9 files changed** (+27 additions, -82 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.7.md` (+1 -0) 📝 `netbox/circuits/forms.py` (+1 -1) 📝 `netbox/dcim/forms.py` (+1 -13) 📝 `netbox/extras/forms.py` (+5 -2) 📝 `netbox/ipam/forms.py` (+0 -8) 📝 `netbox/tenancy/forms.py` (+0 -3) 📝 `netbox/utilities/forms.py` (+19 -39) ➖ `netbox/utilities/templates/widgets/select_api.html` (+0 -9) 📝 `netbox/virtualization/forms.py` (+0 -7) </details> ### 📄 Description ### Fixes: #4108 Improve FilterChoiceField so that it no longer forces the evaluation of available choices on page load. (Choices are populated on-demand via the APISelect widget.) --- <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 22:23:29 +01:00
adam closed this issue 2025-12-29 22:23:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12765