diff options
| author | Rob Hudson | 2009-03-21 10:54:56 -0700 |
|---|---|---|
| committer | Rob Hudson | 2009-03-21 10:56:08 -0700 |
| commit | 30ab58a69510f3fd35e19f6be9b669d2fdf956c0 (patch) | |
| tree | 5d03755816d3aa8e10cc435a2213e306d5572e3c /debug_toolbar/templates | |
| parent | 2e0d4d3b7e2aad03743ca255b053caf55b0b73b2 (diff) | |
| parent | 1a52939905b7a43a9cf83cde6216a98cc5cbc595 (diff) | |
| download | django-debug-toolbar-30ab58a69510f3fd35e19f6be9b669d2fdf956c0.tar.bz2 | |
Adding stack traces to SQL panel to see where the calls are coming from.
Merge branch 'sql_stacktrace'
* sql_stacktrace:
Tuple unpacking of stacktrace variables for niceness.
Add preliminary support for stacktraces to see where SQL queries are coming from.
Diffstat (limited to 'debug_toolbar/templates')
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/panels/sql.html | 22 |
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 0c8e9c3..f05ea97 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 (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 file, line, method in query.stacktrace %} + <tr> + <td>{{ line }}</td> + <td><pre>{{ method|escape }}<pre></td> + <td><pre>{{ file|escape }}</pre></td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} + </td> <td class="syntax">{{ query.sql|safe }}</td> </tr> {% endfor %} |
