Skip to content

Add initial data from request.GET to script forms #3851

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

Closed
steffann opened this issue Jan 6, 2020 · 0 comments
Closed

Add initial data from request.GET to script forms #3851

steffann opened this issue Jan 6, 2020 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@steffann
Copy link
Contributor

steffann commented Jan 6, 2020

Environment

  • Python version: 3.6.7
  • NetBox version: 2.6.11

Proposed Functionality

Most NetBox forms are passed initial=request.GET to the constructor so that the request can pass initial values to the form. The extra/scrips functionality doesn't do that. I propose to add it to make forms behaviour consistent.

Use Case

I have a script that requires the user to select a device. With initial=request.GET I would be able to create a custom link from the device page with URL /extras/scripts/example/demo/?router={{ obj.id }} so that a user can easily click from the device page to the script page with the correct device pre-selected.

Database Changes

None

External Dependencies

None

As usual I'll implement this myself once accepted.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Jan 9, 2020
@jeremystretch jeremystretch self-assigned this Jan 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants