Below doesn't work. How do I make this work? Do I need to parse the
results into an array and then pass to the template?
IN THE VIEW:
cursor = connection.cursor()
cursor.execute("query goes here")
results = cursor.fetchall()
return render_to_response('template.html', {'results': results})
IN THE TEMPLATE:
{% for result in results %}
<br>{{ result[0] }} is a big {{ result[1] }}
{% endfor %}
I haven't checked this in shell, but it looks to be correct,
except that you should write: {{ result.0 }} instead of {{ result
[0] }}
Here's the relevant doc section:
http://docs.djangoproject.com/en/1.1/topics/templates/#variables
--
Tomasz Zielinski
http://pyconsultant.eu