aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorRob Hudson2008-09-23 21:06:39 -0700
committerRob Hudson2008-09-23 21:06:39 -0700
commit159e690ff3d07c8821332942ae722bdf0bdf5208 (patch)
treee0c2284be0ae9fb840abdae142db18bb03ce849b /debug_toolbar/templates
parent7ea7e780b775680be3050a8d6eb71f63b5a1fd34 (diff)
downloaddjango-debug-toolbar-159e690ff3d07c8821332942ae722bdf0bdf5208.tar.bz2
Add catch for non JSON serializable objects and don't show the EXPLAIN link for
these.
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 0a8a6e0..052b36a 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -11,7 +11,11 @@
{% for query in queries %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>{{ query.time|floatformat:"4" }}</td>
- <td><a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"4"|urlencode }}">EXPLAIN</a></td>
+ <td>
+ {% if query.params %}
+ <a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&time={{ query.time|floatformat:"4"|urlencode }}">EXPLAIN</a>
+ {% endif %}
+ </td>
<td class="syntax">{{ query.sql|safe }}</td>
</tr>
{% endfor %}