django QueryDict only returns the last value of a list

后端 未结 3 1607
鱼传尺愫
鱼传尺愫 2021-02-12 09:20

Using django 1.8, I\'m observing something strange. Here is my javascript:

function form_submit(){
  var form = $(\'#form1_id\');
  request = $.post($(this).attr         


        
3条回答
  •  借酒劲吻你
    2021-02-12 10:02

    From here

    This is a feature, not a bug. If you want a list of values for a key, use the following:

    values = request.POST.getlist('key')
    

    And this should help retrieving list items from request.POST in django/python

提交回复
热议问题