I am trying to send data from a webpage to a django view that will be saved as serialized json for the database. If possible, I would like to avoid the django QueryDict object and just read the query using simplejson, smooth and save to the database. What is the best way to send data, so simplejson can smooth it out?
var languages = {}; languages['english'] = ['mark', 'james']; languages['spanish'] = ['amy', 'john']; $.ajax({ type: 'POST', url: '/save/', data: languages, dataType: 'json' });
.
if request.is_ajax() and request.method == 'POST': for key in request.POST: print key valuelist = request.POST.getlist(key) print valuelist
source share