magic-removal: oops, [2500] had tabs instead of spaces; fixed (thanks cmlenz)

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2006-03-07 18:50:56 +00:00
parent 3d64e7e63f
commit 4e292dabc0
1 changed files with 15 additions and 15 deletions

View File

@ -8,25 +8,25 @@ class CursorDebugWrapper:
def execute(self, sql, params=[]): def execute(self, sql, params=[]):
start = time() start = time()
try: try:
return self.cursor.execute(sql, params) return self.cursor.execute(sql, params)
finally: finally:
stop = time() stop = time()
self.db.queries.append({ self.db.queries.append({
'sql': sql % tuple(params), 'sql': sql % tuple(params),
'time': "%.3f" % (stop - start), 'time': "%.3f" % (stop - start),
}) })
def executemany(self, sql, param_list): def executemany(self, sql, param_list):
start = time() start = time()
try: try:
return self.cursor.executemany(sql, param_list) return self.cursor.executemany(sql, param_list)
finally: finally:
stop = time() stop = time()
self.db.queries.append({ self.db.queries.append({
'sql': 'MANY: ' + sql + ' ' + str(tuple(param_list)), 'sql': 'MANY: ' + sql + ' ' + str(tuple(param_list)),
'time': "%.3f" % (stop - start), 'time': "%.3f" % (stop - start),
}) })
def __getattr__(self, attr): def __getattr__(self, attr):
if self.__dict__.has_key(attr): if self.__dict__.has_key(attr):