Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #411 -- CursorDebugWrapper now supports pyformat paramstyle

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5c5d60aa635fe90537e137c20d7619c03c30f12e 1 parent 350c360
Adrian Holovaty authored June 01, 2006

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  django/db/backends/util.py
4  django/db/backends/util.py
@@ -12,6 +12,10 @@ def execute(self, sql, params=()):
12 12
             return self.cursor.execute(sql, params)
13 13
         finally:
14 14
             stop = time()
  15
+            # If params was a list, convert it to a tuple, because string
  16
+            # formatting with '%' only works with tuples or dicts.
  17
+            if not isinstance(params, (tuple, dict)):
  18
+                params = tuple(params)
15 19
             self.db.queries.append({
16 20
                 'sql': sql % tuple(params),
17 21
                 'time': "%.3f" % (stop - start),

0 notes on commit 5c5d60a

Please sign in to comment.
Something went wrong with that request. Please try again.