Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed backend.dictfetchone(), as it wasn't being used anywhere

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b4cfd4fea151da70a77c9ca6197276110aa8c31 1 parent 221f99e
@adrianholovaty adrianholovaty authored
View
4 django/db/backends/__init__.py
@@ -5,6 +5,10 @@
# Import copy of _thread_local.py from Python 2.4
from django.utils._threading_local import local
+def _dict_helper(desc, row):
+ "Returns a dictionary for the given cursor.description and result row."
+ return dict(zip([col[0] for col in desc], row))
+
class BaseDatabaseWrapper(local):
"""
Represents a database connection.
View
1  django/db/backends/ado_mssql/base.py
@@ -102,7 +102,6 @@ def _cursor(self, settings):
supports_tablespaces = True
uses_case_insensitive_names = False
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
1  django/db/backends/dummy/base.py
@@ -39,7 +39,6 @@ def close(self):
supports_constraints = False
supports_tablespaces = False
-dictfetchone = complain
dictfetchmany = complain
dictfetchall = complain
View
1  django/db/backends/mysql/base.py
@@ -184,7 +184,6 @@ def get_server_version(self):
supports_tablespaces = False
uses_case_insensitive_names = False
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
1  django/db/backends/mysql_old/base.py
@@ -203,7 +203,6 @@ def get_server_version(self):
supports_tablespaces = False
uses_case_insensitive_names = False
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
1  django/db/backends/oracle/base.py
@@ -224,7 +224,6 @@ def to_unicode(s):
return force_unicode(s)
return s
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
4 django/db/backends/postgresql/base.py
@@ -200,10 +200,6 @@ def _cursor(self, settings):
supports_tablespaces = False
uses_case_insensitive_names = False
-def dictfetchone(cursor):
- "Returns a row from the cursor as a dict"
- return cursor.dictfetchone()
-
def dictfetchmany(cursor, number):
"Returns a certain number of rows from a cursor as a dict"
return cursor.dictfetchmany(number)
View
1  django/db/backends/postgresql_psycopg2/base.py
@@ -163,7 +163,6 @@ def _cursor(self, settings):
supports_tablespaces = False
uses_case_insensitive_names = False
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
1  django/db/backends/sqlite3/base.py
@@ -120,7 +120,6 @@ def convert_query(self, query, num_params):
supports_tablespaces = False
uses_case_insensitive_names = False
-dictfetchone = util.dictfetchone
dictfetchmany = util.dictfetchmany
dictfetchall = util.dictfetchall
View
7 django/db/backends/util.py
@@ -133,13 +133,6 @@ def _dict_helper(desc, row):
"Returns a dictionary for the given cursor.description and result row."
return dict(zip([col[0] for col in desc], row))
-def dictfetchone(cursor):
- "Returns a row from the cursor as a dict"
- row = cursor.fetchone()
- if not row:
- return None
- return _dict_helper(cursor.description, row)
-
def dictfetchmany(cursor, number):
"Returns a certain number of rows from a cursor as a dict"
desc = cursor.description
Please sign in to comment.
Something went wrong with that request. Please try again.