aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/sql.py
diff options
context:
space:
mode:
authorRob Hudson2008-10-07 21:39:19 -0700
committerRob Hudson2008-10-07 21:39:19 -0700
commitd8935590551dfa708ce46d458c920feb42e3ea2f (patch)
treefdbfd98852c53d42a1b8d7cff627cbfa2f6e626d /debug_toolbar/panels/sql.py
parent03400c2c6b00ca8310cad7f30ac215d2b80d94b2 (diff)
downloaddjango-debug-toolbar-d8935590551dfa708ce46d458c920feb42e3ea2f.tar.bz2
Bringing over patch from Alex Gaynor to fix SQL params when using django.contrib.gis.
Diffstat (limited to 'debug_toolbar/panels/sql.py')
-rw-r--r--debug_toolbar/panels/sql.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py
index a4c18f6..dbf92c6 100644
--- a/debug_toolbar/panels/sql.py
+++ b/debug_toolbar/panels/sql.py
@@ -5,6 +5,7 @@ from django.db import connection
from django.db.backends import util
from django.template.loader import render_to_string
from django.utils import simplejson
+from django.utils.encoding import force_unicode
from django.utils.hashcompat import sha_constructor
class DatabaseStatTracker(util.CursorDebugWrapper):
@@ -20,7 +21,7 @@ class DatabaseStatTracker(util.CursorDebugWrapper):
stop = time.time()
_params = None
try:
- _params = simplejson.dumps(params)
+ _params = simplejson.dumps([force_unicode(x) for x in params])
except TypeError:
pass # object not JSON serializable
# We keep `sql` to maintain backwards compatibility