django templates array assignment

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-03-28T09:57:09Z Indexed on 2010/03/28 10:03 UTC
Read the original article Hit count: 708

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..

© Stack Overflow or respective owner

Related posts about django

Related posts about django-templates