[newforms-admin] Initial form data passed from request.GET isn't handled correctly by the admin
|Reported by:||Matthias Pronk <django@…>||Owned by:||nobody|
|Severity:||Keywords:||nfa, newforms, admin|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The admin interface used to pass initial data from the URL to the forms, so calling for example:
Would result in the "username" field to be prefilled with "foo".
This is broken in recent newforms-admin because the MultiValueDict (QueryDict) is used to extend an ordinary dict in django.newforms.forms.
The way to resolve this problem is to "flatten" the MultiValueDict to an ordinary dictionary, before passing it to the ModelForm.
Thanks to brosner on #django for the help! (basically fixing it ;)
Change History (5)
Changed 8 years ago by Matthias Pronk <django@…>
comment:1 Changed 8 years ago by Matthias Pronk <django@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to invalid
- Status changed from new to closed
comment:2 Changed 8 years ago by brosner
- Resolution invalid deleted
- Status changed from closed to reopened