My client is passing this json as a post to django server:
data={ 'supplier': supplier_name,
'date': date,
'payment':payment,
'materials':[{"name":name,"qtd":qtd,"price":price},
{"name":name,"qtd":qtd,"price":price},
{"name":name,"qtd":qtd,"price":price}]
}
I'm using push to put materials:
data['materials'].push({"name":name,"qtd":qtd,"price":price});
My django view handles data like this:
supplier=request.POST.get('supplier')
date=request.POST.get('date')
When I try to do this, the materials content is "none":
materials=request.POST.get('materials')
How can get a list use in further code?
Ajax is being sent like this:
$.ajax({
type:"POST",
url:"{% url 'validate_purchase' %}",
data: data,
dataType: 'json',
success: function(data){
}
});