Pre-filling fields in create view
See original GitHub issueIt would be nice to be able to pre-configure the create_view
endpoint by passing in GET parameters to it.
So this URL:
http://mysite.dev/admin/productsku/?size=2&variant=3&season=1&season=2&ean_code=123456789
Would produce something like this:
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Django: CreateView with pre-populated and uneditable fields ...
I would like to do this with an extended version of CreateView which will be able to handle data on pre-populated fields.
Read more >How to pre-populate a form in CreateView : r/djangolearning
You can pass an initial model to your form, or data as a python dict. There are several approaches to marking fields as...
Read more >[Solved] Prepopulate fields in partial view create - CodeProject
Hi all, New to MVC development. Struggling to load a partial view for 'Create' with prepopulated field values from Parent View. Basically I...
Read more >Need some help with preselecting form fields... - Django Forum
I am able to prefill the Product field but cannot figure out how to pass the ... CreateView): model = Listing form_class =...
Read more >How to Prepopulate Form Fields With Data From Other Tables ...
As you already know, in Jotform Tables, you can add a new tab to view data from other forms you have. You could...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since it seems that neither a code sample or a recipe section were added for this, and since I struggled with this, I thought I would post my solution.
Also, I’m using this to create action buttons to create entries for another view, with references to the previous view selected by default. If worried about non-safe values, just validate that the request arguments are in acceptable range before using them.
For anyone coming here, I had to tweak https://github.com/flask-admin/flask-admin/issues/1051#issuecomment-372010195 a bit to make it work as updating the form data fails