aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorRob Hudson2009-01-23 10:59:59 -0800
committerRob Hudson2009-01-23 10:59:59 -0800
commit85bd265bd5fe9dda44c67c2b2e618a79c2fb8fdc (patch)
tree6b4b43b112ef98321b2e78d1b486f494cc4dd1e8 /debug_toolbar/templates
parentc3bcecfd13d8c82c9ac0a88a578bdeb4ad7cfc9d (diff)
downloaddjango-debug-toolbar-85bd265bd5fe9dda44c67c2b2e618a79c2fb8fdc.tar.bz2
Add preliminary support for stacktraces to see where SQL queries are coming from.
I'm wanting to test this a bit more before I merge it in fully. Feedback welcome.
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 7de2220..1896e3c 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -4,6 +4,7 @@
<tr>
<th>Time&nbsp;(ms)</th>
<th>Action</th>
+ <th>Stacktrace</th>
<th>Query</th>
</tr>
</thead>
@@ -20,6 +21,27 @@
{% endif %}
{% endif %}
</td>
+ <td>
+ {% if query.stacktrace %}
+ <div class="djSQLShowStacktraceDiv"><a class="djSQLShowStacktrace" href="#">Toggle Stacktrace</a></div>
+ <div class="djSQLHideStacktraceDiv" style="display:none;">
+ <table>
+ <tr>
+ <th>Line</th>
+ <th>Method</th>
+ <th>File</th>
+ </tr>
+ {% for s in query.stacktrace %}
+ <tr>
+ <td>{{ s.1 }}</td>
+ <td><pre>{{ s.2|escape }}<pre></td>
+ <td><pre>{{ s.0|escape }}</pre></td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ {% endif %}
+ </td>
<td class="syntax">{{ query.sql|safe }}</td>
</tr>
{% endfor %}