aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorAlex Gaynor2008-10-06 18:33:49 -0400
committerAlex Gaynor2008-10-06 18:33:49 -0400
commitc10e9814d878eb06cba33387f6b5681e47b163fb (patch)
tree0e3192b8f3b496fa1a3fa07a51c0f9a3acfd7a50 /debug_toolbar/templates
parent0368d75afbe578951bcded286a3122c5302e3e4d (diff)
parenta3492e14765e3f898efc26913a8e8c4445a837b4 (diff)
downloaddjango-debug-toolbar-c10e9814d878eb06cba33387f6b5681e47b163fb.tar.bz2
resolved merge conflicts
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html2
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_profile.html26
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_select.html30
3 files changed, 58 insertions, 0 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 6a2d077..d35d83e 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -13,7 +13,9 @@
<td>{{ query.time|floatformat:"4" }}</td>
<td>
{% if query.params %}
+ <a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"4"|urlencode }}&hash={{ query.hash }}">SELECT</a>
<a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"4"|urlencode }}&hash={{ query.hash }}">EXPLAIN</a>
+ <a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"4"|urlencode }}&hash={{ query.hash }}">PROFILE</a>
{% endif %}
</td>
<td class="syntax">{{ query.sql|safe }}</td>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
new file mode 100644
index 0000000..c1d04ce
--- /dev/null
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
@@ -0,0 +1,26 @@
+<a class="back" href="">&laquo;&nbsp;Back</a>
+<h3>SQL Profiled</h3>
+<dl>
+ <dt>Executed SQL</dt>
+ <dd><pre>{{ sql|safe }}</pre></dd>
+ <dt>Time</dt>
+ <dd>{{ time }} ms</dd>
+</dl>
+<table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'odd' 'even' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html
new file mode 100644
index 0000000..73109ef
--- /dev/null
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html
@@ -0,0 +1,30 @@
+<a class="back" href="">&laquo;&nbsp;Back</a>
+<h3>SQL Selected</h3>
+<dl>
+ <dt>Executed SQL</dt>
+ <dd><pre>{{ sql|safe }}</pre></dd>
+ <dt>Time</dt>
+ <dd>{{ time }} ms</dd>
+</dl>
+{% if result %}
+<table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'odd' 'even' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% else %}
+ <p>Empty set</p>
+{% endif %}