【发布时间】:2016-12-27 07:53:52
【问题描述】:
我的网址有http://127.0.0.1:8000/theme/category/?q=check,hello,如何检索查询参数的值
当我尝试做query = request.GET.get('q') 时,我只得到check 但hello 不见了。
从查询字符串中获取 check 和 hello 的任何帮助都会有所帮助
【问题讨论】:
标签: python django query-parameters
我的网址有http://127.0.0.1:8000/theme/category/?q=check,hello,如何检索查询参数的值
当我尝试做query = request.GET.get('q') 时,我只得到check 但hello 不见了。
从查询字符串中获取 check 和 hello 的任何帮助都会有所帮助
【问题讨论】:
标签: python django query-parameters
对于 URL http://example.com/blah/?myvar=123&myvar=567,您可以像这样使用getlist():
request.GET.getlist('myvar')
【讨论】:
您可以使用 %2C,它是 , 的 url 编码值。
来源:Alternative to sending comma separated parameter by querystring
【讨论】: