[PR #4678] [CLOSED] 4525: better support for ScriptVariable fields with multiple values #12898

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4678
Author: @steffann
Created: 5/22/2020
Status: Closed

Base: developHead: 4525-initial-multiobjectvar


📝 Commits (2)

  • 3209464 ScriptVar subclasses indicate whether they support multiple values, and ScriptForm honors that
  • 5e77ea4 Add tests for multi-value ScriptVariables

📊 Changes

3 files changed (+82 additions, -0 deletions)

View changed files

📝 netbox/extras/forms.py (+18 -0)
📝 netbox/extras/scripts.py (+4 -0)
📝 netbox/extras/tests/test_scripts.py (+60 -0)

📄 Description

Fixes: #4525

Implemented by adding multiple_values as a class property on ScriptVariable to determine which fields require a single value and which fields support multiple values and adding code to ScriptForm.__init__ to provide corresponding initial values.


🔄 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/4678 **Author:** [@steffann](https://github.com/steffann) **Created:** 5/22/2020 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `4525-initial-multiobjectvar` --- ### 📝 Commits (2) - [`3209464`](https://github.com/netbox-community/netbox/commit/32094643f9eb053b87a85eceadcda68e48bc6c14) ScriptVar subclasses indicate whether they support multiple values, and ScriptForm honors that - [`5e77ea4`](https://github.com/netbox-community/netbox/commit/5e77ea4bce757a750263d29b59f2a5d1df294df8) Add tests for multi-value ScriptVariables ### 📊 Changes **3 files changed** (+82 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/forms.py` (+18 -0) 📝 `netbox/extras/scripts.py` (+4 -0) 📝 `netbox/extras/tests/test_scripts.py` (+60 -0) </details> ### 📄 Description ### Fixes: #4525 Implemented by adding `multiple_values` as a class property on `ScriptVariable` to determine which fields require a single value and which fields support multiple values and adding code to `ScriptForm.__init__` to provide corresponding `initial` values. --- <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:24:15 +01:00
adam closed this issue 2025-12-29 22:24:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12898