          query = self.convert_query(query, len(params))
          return Database.Cursor.execute(self, query, params)
  
      def executemany(self, query, param_list):
          query = self.convert_query(query, len(param_list[0]))
          return Database.Cursor.executemany(self, query, param_list)
  
      def convert_query(self, query, num_params):
          return query % tuple("?" * num_params)
  
  def _sqlite_extract(lookup_type, dt):
 
</s> remove     def _rewrite_args(self, query, params=None):
        if params is None:
            params = []
        else:
            params = self._format_params(params)
        args = [(':arg%d' % i) for i in range(len(params))]
        query = smart_str(query, self.charset) % tuple(args)
        # cx_Oracle wants no trailing ';' for SQL statements.  For PL/SQL, it
        # it does want a trailing ';' but not a trailing '/'.  However, these
        # characters must be included in the original query in case the query
        # is being passed to SQL*Plus.
        if query.endswith(';') or query.endswith('/'):
            query = query[:-1]
        return query, params

 </s> add  </s> remove         query, params = self._rewrite_args(query, params)
 </s> add         if params is None:
            params = []
        else:
            params = self._format_params(params)
        args = [(':arg%d' % i) for i in range(len(params))]
        # cx_Oracle wants no trailing ';' for SQL statements.  For PL/SQL, it
        # it does want a trailing ';' but not a trailing '/'.  However, these
        # characters must be included in the original query in case the query
        # is being passed to SQL*Plus.
        if query.endswith(';') or query.endswith('/'):
            query = query[:-1]
        query = smart_str(query, self.charset) % tuple(args) </s> remove         query, params = self._rewrite_args(query, params)
        return Database.Cursor.executemany(self, query, params)
 </s> add         try:
          args = [(':arg%d' % i) for i in range(len(params[0]))]
        except (IndexError, TypeError):
          # No params given, nothing to do
          return None
        # cx_Oracle wants no trailing ';' for SQL statements.  For PL/SQL, it
        # it does want a trailing ';' but not a trailing '/'.  However, these
        # characters must be included in the original query in case the query
        # is being passed to SQL*Plus.
        if query.endswith(';') or query.endswith('/'):
            query = query[:-1]
        query = smart_str(query, self.charset) % tuple(args)
        new_param_list = [self._format_params(i) for i in params]
        return Database.Cursor.executemany(self, query, new_param_list)
        try:
          query = self.convert_query(query, len(param_list[0]))
          return Database.Cursor.executemany(self, query, param_list)
        except (IndexError,TypeError):
          # No parameter list provided
          return None
          query = self.convert_query(query, len(params))
          return Database.Cursor.execute(self, query, params)
  
      def executemany(self, query, param_list):
        try:
          query = self.convert_query(query, len(param_list[0]))
          return Database.Cursor.executemany(self, query, param_list)
        except (IndexError,TypeError):
          # No parameter list provided
          return None
        try:
          query = self.convert_query(query, len(param_list[0]))
          return Database.Cursor.executemany(self, query, param_list)
        except (IndexError,TypeError):
          # No parameter list provided
          return None
  
      def convert_query(self, query, num_params):
          return query % tuple("?" * num_params)
  
  def _sqlite_extract(lookup_type, dt):
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #4896: fixed #4765: Patch for cursor.executemany using oracle and 
sqlite3. Thanks, jdetaeye@www.frepple.com


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6218 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/db/backends/sqlite3/base.py