#27559: Admin changelist turns QueryDict into dict -----------------------------------------+------------------------ Reporter: Jonas | Owner: nobody Type: Uncategorized | Status: new Component: contrib.admin | Version: master Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -----------------------------------------+------------------------ We implemented a custom SimpleListFilter for the admin which presents the choices as a list of checkboxes. Pressing "submit" sends the list to the backend for filtering.
Unfortunately, this doesn't really work well and it took us a while to find out why: the `ChangeList` view turns `request.GET` (a `QueryDict`) [https://github.com/django/django/blob/master/django/contrib/admin/views/main.py#L67 into a dict]. This means, a query string in the form of `?q=123&state=1&state=2` simply loses all state values except the last one. It still works in principle but as soon as you e.g. click on a column heading to re-sort, the link only shows the last value instead of all of them. I checked the git log and traced this re-casting back to the "[https://github.com/django/django/commit/9dda4abee1225db7a7b195b84c915fdd141a7260 #diff-ea7d8c684e252f3dad6aa458df7d3070R109 NEW ADMIN MERGE]" in 2005. It was probably done to be able to manipulate the parameters but seems to be a very lossy operation for this purpose. Shouldn't `self.params` rather be kept as a `QueryDict`? We'll get started on a pull request if there's interest. ([https://groups.google.com/forum/#!topic/django-developers/dxEAq8_DSeM Asked on django-developers]) -- Ticket URL: <https://code.djangoproject.com/ticket/27559> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/048.5ca7faa23a8c1f45feb78687d81157e6%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.