Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/backends/util.py
View
4 django/db/backends/util.py
@@ -12,6 +12,10 @@ def execute(self, sql, params=()):
return self.cursor.execute(sql, params)
finally:
stop = time()
+ # If params was a list, convert it to a tuple, because string
+ # formatting with '%' only works with tuples or dicts.
+ if not isinstance(params, (tuple, dict)):
+ params = tuple(params)
self.db.queries.append({
'sql': sql % tuple(params),
'time': "%.3f" % (stop - start),
Please sign in to comment.
Something went wrong with that request. Please try again.