diff options
| author | Chris Lamb | 2009-10-14 14:45:51 +0100 |
|---|---|---|
| committer | Rob Hudson | 2009-11-02 12:57:14 -0800 |
| commit | f6ada2c4f5eec83adc926a6e26d2697090660a81 (patch) | |
| tree | 534e57db275850f2d812f03c731aaa18d6f819d6 /debug_toolbar/templates | |
| parent | a6804ad6881dfade23af4379e5da505a9762ed9e (diff) | |
| download | django-debug-toolbar-f6ada2c4f5eec83adc926a6e26d2697090660a81.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> |
