Wednesday, 28 August 2013

how to POST list of objects in django?

how to POST list of objects in django?

Sorry I'm new to django, I need to transfer a list by POST in django, The
problem is that the list elements need to be complex objects, dictionaries
every list entry should have first name and last name parameters. I only
know how to make list of simple values like this :
<input type="hidden" name="alist" value="1" />
<input type="hidden" name="alist" value="2" />
<input type="hidden" name="alist" value="3" />
and then :
alist = request.POST.getlist('alist')
What is the best practice of doing this? Thanks

No comments:

Post a Comment