Opened 4 years ago
Closed 4 years ago
#32561 closed Bug (invalid)
Unpacking request.GET into a function call turns the values into lists with one item.
Reported by: | atursams | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 3.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Going to this url:
http://localhost:8000/api/quote?from_currency_code=EUR&amount=300&to_currency_code=ILS
from django.shortcuts import render def print_params(**kwargs): print(*kwargs.items()) async def index(request): print_params(**request.GET)
results in this
('from_currency_code', ['EUR']) ('amount', ['300']) ('to_currency_code', ['ILS'])
This is an odd behavior. request.GET.items() has the expected result.
Note:
See TracTickets
for help on using tickets.
This is expected behaviour of
QueryDict
. From the docs:(The underlying storage is a list.)
This issue tracker is not really the appropriate place for this kind of query. Please see TicketClosingReasons/UseSupportChannels.