diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-06-01 03:57:07 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-06-01 03:57:07 +0000 |
| commit | 5c5d60aa635fe90537e137c20d7619c03c30f12e (patch) | |
| tree | 111198b5d482870ca6d05d7127e937adb69c6424 | |
| parent | 350c36077664154b1a4d86d670b33c72d7591d98 (diff) | |
Fixed #411 -- CursorDebugWrapper now supports pyformat paramstyle
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/backends/util.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/backends/util.py b/django/db/backends/util.py index b9c6f573c9..3098a53556 100644 --- a/django/db/backends/util.py +++ b/django/db/backends/util.py @@ -12,6 +12,10 @@ class CursorDebugWrapper: 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), |
