-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expose API_SELECT widget to custom scripts. #3766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide. |
We need to do this but I am not sure our current widget API will work very well. We likely need to investigate modifying it or creating a new one for use with custom scripts. |
I have managed to expose the widget API for my own custom scripts, I will have to see what changes I made. I believe I simply had it inherit something additional. |
Yeah, it looks like I just created separate classes within the individual scripts:
I think this would be cleaner if it were incorporated into the main classes, as overriding certain things would not be required. |
Hi Daniel, Thanks for sharing the code.
But the problem is that device_id above is static and I would like to dynamically pass device id depending on previously selected device in another ObjectVar. |
@pszulczewski Please take any help requests to the discussion group. |
I am going to take this on (unless someone else wants to give it a shot). |
…_script_fields Fixes: #3766 - Enable widget usage in scripts
Uh oh!
There was an error while loading. Please reload this page.
Environment
Proposed Functionality
Add more advanced ObjectVar filtering mechanism in Custom Scripts.
Custom script to use widgets like API_SELECT to relate second ObjectVar on already selected first ObjectVar.
Use Case
Use Case 1
Two ObjectVars
1st Device
2nd Interfaces
Second ObjectVar is limited to interfaces only for selected device in first ObjectVar
Use Case 2
Two ObjectVars
1st Site
2nd Device
Second ObjectVar is limited to Devices only for selected site in first ObjectVar
Database Changes
None
External Dependencies
None
The text was updated successfully, but these errors were encountered: