[PR #11880] [MERGED] Add fieldsets functionality to scripts to allow for form field groupings #13865

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11880
Author: @ryanmerolle
Created: 3/2/2023
Status: Merged
Merged: 3/14/2023
Merged by: @jeremystretch

Base: developHead: issue_11833


📝 Commits (7)

📊 Changes

3 files changed (+51 additions, -6 deletions)

View changed files

📝 docs/customization/custom-scripts.md (+17 -2)
📝 netbox/extras/scripts.py (+12 -0)
📝 netbox/templates/extras/script.html (+22 -4)

📄 Description

Fixes: #11833

Introduces a fieldsets script attribute defined under a class named Meta within the script.

Notes:

  • If set this ignores the field_order attribute.
  • If a field is missed from the fieldset it will not be rendered (I could change this default if we want, but I do not think this would be consistent with other implementations of fieldset).

Any concerns or changes needed, I'd be happy to address.

Given this is not a breaking change, it would be nice in the next minor release.


🔄 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/11880 **Author:** [@ryanmerolle](https://github.com/ryanmerolle) **Created:** 3/2/2023 **Status:** ✅ Merged **Merged:** 3/14/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `issue_11833` --- ### 📝 Commits (7) - [`50a88bd`](https://github.com/netbox-community/netbox/commit/50a88bdc6af34beadcc0c0b1dccdee64ff14ec4d) update script template - [`f81fab1`](https://github.com/netbox-community/netbox/commit/f81fab1271de69bc11abbc22399d126afe372b05) update docs - [`c108854`](https://github.com/netbox-community/netbox/commit/c1088549caf6b4155721574f3b1432e181a1ec66) introduce default_fieldset - [`8adc877`](https://github.com/netbox-community/netbox/commit/8adc87796b28f20b10c5c7e920f8d3c1ef1eedaf) correct custom script docs - [`25e965e`](https://github.com/netbox-community/netbox/commit/25e965edb2c3556760721345fcddd8be992486f5) default to use fieldsets in scripts - [`3219015`](https://github.com/netbox-community/netbox/commit/3219015a35681135f22da5329e0f58647607c4c2) update scripts docs for new behavior - [`b0144d1`](https://github.com/netbox-community/netbox/commit/b0144d1bd869e25cd1ef79cd7ce315e34fb9ff58) Misc cleanup ### 📊 Changes **3 files changed** (+51 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/customization/custom-scripts.md` (+17 -2) 📝 `netbox/extras/scripts.py` (+12 -0) 📝 `netbox/templates/extras/script.html` (+22 -4) </details> ### 📄 Description ### Fixes: #11833 Introduces a `fieldsets` script attribute defined under a class named `Meta` within the script. Notes: - If set this ignores the field_order attribute. - If a field is missed from the fieldset it will not be rendered (I could change this default if we want, but I do not think this would be consistent with other implementations of fieldset). Any concerns or changes needed, I'd be happy to address. Given this is not a breaking change, it would be nice in the next minor release. --- <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:21:14 +01:00
adam closed this issue 2025-12-29 23:21:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13865