From b7d7e9f876b67be35d8a24405f6940b2dcb66e97 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Sat, 12 Sep 2009 16:42:59 -0700 Subject: Fixed to only show the link for requesting the SELECT data if the query is a SELECT query. --- debug_toolbar/panels/sql.py | 3 ++- debug_toolbar/templates/debug_toolbar/panels/sql.html | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 17f4598..17130ca 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -106,7 +106,8 @@ class DatabaseStatTracker(util.CursorDebugWrapper): 'stacktrace': stacktrace, 'start_time': start, 'stop_time': stop, - 'is_slow': (duration > SQL_WARNING_THRESHOLD) + 'is_slow': (duration > SQL_WARNING_THRESHOLD), + 'is_select': sql.lower().strip().startswith('select'), }) util.CursorDebugWrapper = DatabaseStatTracker diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html index 81188a9..ba8a2c3 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html @@ -14,7 +14,9 @@