aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorChris Lamb2009-10-14 14:45:51 +0100
committerRob Hudson2009-11-02 12:24:42 -0800
commit3f81a95105381a0ffabc46ae6ab84d69ace89720 (patch)
treef341f27d74a6f17177de7113d69719952620fdab /debug_toolbar/templates
parent0d544a7f2ddbde72b9fe23ce627ad82af0abad0b (diff)
downloaddjango-debug-toolbar-3f81a95105381a0ffabc46ae6ab84d69ace89720.tar.bz2
Show context where SQL query originated from template
Signed-off-by: Chris Lamb <lamby@debian.org> Signed-off-by: Rob Hudson <rob@cogit8.org>
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 038deaf..331306b 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -47,6 +47,17 @@
</tr>
{% endfor %}
</table>
+ {% if query.template_info %}
+ <table>
+ {% for line in query.template_info.context %}
+ <tr>
+ <td>{{ line.num }}</td>
+ <td><pre style="font-family: monospace;{% if line.highlight %}background-color: lightgrey{% endif %}">{{ line.content }}</pre></td>
+ </tr>
+ {% endfor %}
+ </table>
+ <p><strong>{{ query.template_info.name|default:"(unknown)" }}</strong></p>
+ {% endif %}
</div>
{% endif %}
<span class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="width:{{ query.width_ratio }}%; left:{{ query.start_offset }}%;"></span>