diff options
| author | Chris Lamb | 2009-10-14 14:45:51 +0100 |
|---|---|---|
| committer | Rob Hudson | 2009-11-02 12:24:42 -0800 |
| commit | 3f81a95105381a0ffabc46ae6ab84d69ace89720 (patch) | |
| tree | f341f27d74a6f17177de7113d69719952620fdab /debug_toolbar/templates | |
| parent | 0d544a7f2ddbde72b9fe23ce627ad82af0abad0b (diff) | |
| download | django-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.html | 11 |
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> |
