#25347: QueryDict can't return a list for a select multiple form element
-------------------------------+--------------------------------------
Reporter: drakej | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by drakej):
I'm not sure how that's required. This isn't a bug but rather a limitation
that I'm hoping can be fixed as a new feature.
If you iterate over request.POST, I'm expecting that __getitem__ can
handle giving me a list or a scalar depending on what was sent in the form
data. Right now I have to know the actual key in order to extract the
given key as a list so I don't end up with the last item in it.
The other alternative I have is to run getlist() on every single key and
then iterate over scalars as if they are lists which just adds unneeded
overhead. I guess I could also roll out my own request data parser to
replace QueryDict, but it seems like this should be core functionality
that QueryDict can get right itself.
--
Ticket URL: <https://code.djangoproject.com/ticket/25347#comment:2>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.8f497535696090f6d32125d5d7eacf9f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.