summaryrefslogtreecommitdiff
path: root/django/core/db/base.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
commitf69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch)
treed3b32e84cd66573b3833ddf662af020f8ef2f7a8 /django/core/db/base.py
parentd5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (diff)
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/db/base.py')
-rw-r--r--django/core/db/base.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/django/core/db/base.py b/django/core/db/base.py
deleted file mode 100644
index 62cca9d0be..0000000000
--- a/django/core/db/base.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from time import time
-
-class CursorDebugWrapper:
- def __init__(self, cursor, db):
- self.cursor = cursor
- self.db = db
-
- def execute(self, sql, params=[]):
- start = time()
- result = self.cursor.execute(sql, params)
- stop = time()
- self.db.queries.append({
- 'sql': sql % tuple(params),
- 'time': "%.3f" % (stop - start),
- })
- return result
-
- def executemany(self, sql, param_list):
- start = time()
- result = self.cursor.executemany(sql, param_list)
- stop = time()
- self.db.queries.append({
- 'sql': 'MANY: ' + sql + ' ' + str(tuple(param_list)),
- 'time': "%.3f" % (stop - start),
- })
- return result
-
- def __getattr__(self, attr):
- if self.__dict__.has_key(attr):
- return self.__dict__[attr]
- else:
- return getattr(self.cursor, attr)