#9089 closed New feature (fixed)
urlencode should support MutliValueDict
Reported by: | Thomas Güttler | Owned by: | gptvnt |
---|---|---|---|
Component: | Core (Other) | Version: | 1.0 |
Severity: | Normal | Keywords: | |
Cc: | Oliver Beattie | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This small patch of django.utils.http lets urlencode() handle list values in MultiValueDict instances
correctly.
Before:
>>> from django.utils.http import urlencode >>> from django.utils.datastructures import MultiValueDict >>> urlencode(MultiValueDict({'test': [1, 2, 3]}), doseq=True) 'test=3'
With patch:
>>> urlencode(MultiValueDict({'test': [1, 2, 3]}), doseq=True) 'test=1&test=2&test=3'
Attachments (3)
Change History (15)
comment:1 Changed 15 years ago by
Component: | Uncategorized → Core framework |
---|
comment:2 Changed 15 years ago by
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Changed 15 years ago by
Attachment: | multidict-tests-r9066.diff added |
---|
comment:3 Changed 15 years ago by
Needs tests: | unset |
---|
Changed 15 years ago by
Attachment: | urlencode-multivaluedict.diff added |
---|
The new patch includes the unittest written by kratorius.
comment:5 Changed 14 years ago by
Cc: | Oliver Beattie added |
---|
comment:6 Changed 14 years ago by
Hate to nag, but is there a reason this hasn't been committed? Seems like such an obvious change that is actually useful. I'm using a custom urlencode
function for now, but I really don't see any reason this shouldn't be checked-in.
comment:7 Changed 13 years ago by
Owner: | changed from nobody to gptvnt |
---|---|
Status: | new → assigned |
I verified, the patch is good. Although the tests have been restructured recently and the test patch attached is no longer valid. I take the responsibility of rewriting the test patch as per the latest structure.
comment:8 Changed 13 years ago by
Patch needs improvement: | set |
---|---|
Severity: | → Normal |
Type: | → New feature |
Patch needs improvement as per gptvnt's comment.
Changed 13 years ago by
Attachment: | urlencode-multivaluedict.2.diff added |
---|
Updated patch with better tests
comment:9 Changed 13 years ago by
Patch needs improvement: | unset |
---|
comment:10 Changed 13 years ago by
Easy pickings: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:12 Changed 12 years ago by
Cc: | hv@… removed |
---|---|
UI/UX: | unset |
Repeat after me: "whenever I submit a patch to add a new feature, it must include tests." Thankyou. :-)