How to handle request.GET with multiple variables for the same parameter in Django

前端 未结 2 837
Happy的楠姐
Happy的楠姐 2020-11-29 01:18

In a Django view you can access the request.GET[\'variablename\'], so in your view you can do something like this:

myvar = request.GET[\'myvar\'         


        
2条回答
  •  醉话见心
    2020-11-29 01:26

    You want the getlist() function of the GET object:

    request.GET.getlist('myvar')
    

提交回复
热议问题