#20379: request.POST.getlist fails when submitting a JS array of JS objects
-------------------------------------------+--------------------
     Reporter:  Alex Krupp <alex.krupp@…>  |      Owner:  nobody
         Type:  Uncategorized              |     Status:  new
    Component:  Uncategorized              |    Version:  1.5
     Severity:  Normal                     |   Keywords:
 Triage Stage:  Unreviewed                 |  Has patch:  0
Easy pickings:  0                          |      UI/UX:  0
-------------------------------------------+--------------------
 As described in the summary, request.POST.getlist fails when applied to an
 array of objects instead of an array of strings:

 '''This works:'''

 Frontend:
 var test = ['a', 'b', 'c']
 $.post("/upload", {"test": test}, function(response) {alert(response);});

 Backend:
 print request.POST.getlist('test[]')
 >[u'a', u'b', u'c']  #Success

 '''This fails:'''

 Frontend:
 var foo = {}
 foo.bar = "asdf"
 test = [foo, foo, foo]
 $.post("/upload", {"test": test}, function(response) {alert(response);});

 Backend:

 print request.POST.getlist('test[]')
 >[]  #Fail

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20379>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to