django templates array assignment
- by Hulk
The following is in views:
rows=query.evaluation_set.all()
row_arr = []
for row in rows:
row_arr.append(row.row_details)
dict.update({'row_arr' : row_arr ,'col_arr' : col_arr})
return render_to_response('valuemart/show.html',context_instance=RequestContext(request,{'dict': dict}))
How to extract the row_Arr array in the templates in javascript and list out all its values.row_Arr contains data of a column
<script>
var row_arr = '{{dict.row_arr}}';
//extract values here
</script>
Thanks..