Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1624 -- Made small changes to parameters in exe…

…cutemany() in cursor implementations in MySQL and SQLite database backends

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2686 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af0056201e4484adaf7d91b8a061db1ec3e8f41d 1 parent 6d95320
Adrian Holovaty authored April 12, 2006
9  django/db/backends/sqlite3/base.py
@@ -62,15 +62,14 @@ class SQLiteCursorWrapper(Database.Cursor):
62 62
     """
63 63
     Django uses "format" style placeholders, but pysqlite2 uses "qmark" style.
64 64
     This fixes it -- but note that if you want to use a literal "%s" in a query,
65  
-    you'll need to use "%%s" (which I belive is true of other wrappers as well).
  65
+    you'll need to use "%%s".
66 66
     """
67  
-
68  
-    def execute(self, query, params=[]):
  67
+    def execute(self, query, params=()):
69 68
         query = self.convert_query(query, len(params))
70 69
         return Database.Cursor.execute(self, query, params)
71 70
 
72  
-    def executemany(self, query, params=[]):
73  
-        query = self.convert_query(query, len(params[0]))
  71
+    def executemany(self, query, param_list):
  72
+        query = self.convert_query(query, len(param_list[0]))
74 73
         return Database.Cursor.executemany(self, query, params)
75 74
 
76 75
     def convert_query(self, query, num_params):
2  django/db/backends/util.py
@@ -6,7 +6,7 @@ def __init__(self, cursor, db):
6 6
         self.cursor = cursor
7 7
         self.db = db
8 8
 
9  
-    def execute(self, sql, params=[]):
  9
+    def execute(self, sql, params=()):
10 10
         start = time()
11 11
         try:
12 12
             return self.cursor.execute(sql, params)

0 notes on commit af00562

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