I'm using ajax and django for dynamically populate a combo box. ajax component works really fine and it parse the data to the view but int the view, when i'm using the spiting function it gives me a exception called "Value Error:need more than 1 value to unpack ". can anyone helps me to figure out the error :) :) code:
def dropdownPopulate(request):
if request.method=='POST' :
key = request.POST['id']
else:
key=""
level, tree_id=key.split(",")
next_nodes=Structure.objects.filter(tree_id=key[tree_id]).filter(level=key[level])
context={'name':next_nodes}
return render_to_response('renderAjax.html',context)