我的网址有http://127.0.0.1:8000/theme/category/?q=check,hello
,如何以检索查询参数Django的检索多个查询参数
的值,当我尝试做query = request.GET.get('q')
我只得到check
但hello
丢失。
在得到两个检查任何帮助和Hello从查询字符串,将有助于
我的网址有http://127.0.0.1:8000/theme/category/?q=check,hello
,如何以检索查询参数Django的检索多个查询参数
的值,当我尝试做query = request.GET.get('q')
我只得到check
但hello
丢失。
在得到两个检查任何帮助和Hello从查询字符串,将有助于
您可以使用%2C,至极的是URL编码值。
来源:Alternative to sending comma separated parameter by querystring
谢谢回复 – Coeus
对于这个网址:
http://example.com/blah/?myvar=123&myvar=567
您可以使用getlist()
这样的:
request.GET.getlist('myvar')
感谢您的回复 – Coeus
尝试'request.GET中[ 'Q']' –