mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -5,6 +5,10 @@ except ImportError: | |||||||
|     # Import copy of _thread_local.py from Python 2.4 |     # Import copy of _thread_local.py from Python 2.4 | ||||||
|     from django.utils._threading_local import local |     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): | class BaseDatabaseWrapper(local): | ||||||
|     """ |     """ | ||||||
|     Represents a database connection. |     Represents a database connection. | ||||||
|   | |||||||
| @@ -102,7 +102,6 @@ supports_constraints = True | |||||||
| supports_tablespaces = True | supports_tablespaces = True | ||||||
| uses_case_insensitive_names = False | uses_case_insensitive_names = False | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall  = util.dictfetchall | dictfetchall  = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -39,7 +39,6 @@ class DatabaseWrapper(object): | |||||||
|  |  | ||||||
| supports_constraints = False | supports_constraints = False | ||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| dictfetchone = complain |  | ||||||
| dictfetchmany = complain | dictfetchmany = complain | ||||||
| dictfetchall = complain | dictfetchall = complain | ||||||
|  |  | ||||||
|   | |||||||
| @@ -184,7 +184,6 @@ supports_constraints = True | |||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| uses_case_insensitive_names = False | uses_case_insensitive_names = False | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall  = util.dictfetchall | dictfetchall  = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -203,7 +203,6 @@ supports_constraints = True | |||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| uses_case_insensitive_names = False | uses_case_insensitive_names = False | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall  = util.dictfetchall | dictfetchall  = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -224,7 +224,6 @@ def to_unicode(s): | |||||||
|         return force_unicode(s) |         return force_unicode(s) | ||||||
|     return s |     return s | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall  = util.dictfetchall | dictfetchall  = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -200,10 +200,6 @@ supports_constraints = True | |||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| uses_case_insensitive_names = 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): | def dictfetchmany(cursor, number): | ||||||
|     "Returns a certain number of rows from a cursor as a dict" |     "Returns a certain number of rows from a cursor as a dict" | ||||||
|     return cursor.dictfetchmany(number) |     return cursor.dictfetchmany(number) | ||||||
|   | |||||||
| @@ -163,7 +163,6 @@ supports_constraints = True | |||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| uses_case_insensitive_names = False | uses_case_insensitive_names = False | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall = util.dictfetchall | dictfetchall = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -120,7 +120,6 @@ supports_constraints = False | |||||||
| supports_tablespaces = False | supports_tablespaces = False | ||||||
| uses_case_insensitive_names = False | uses_case_insensitive_names = False | ||||||
|  |  | ||||||
| dictfetchone = util.dictfetchone |  | ||||||
| dictfetchmany = util.dictfetchmany | dictfetchmany = util.dictfetchmany | ||||||
| dictfetchall  = util.dictfetchall | dictfetchall  = util.dictfetchall | ||||||
|  |  | ||||||
|   | |||||||
| @@ -133,13 +133,6 @@ def _dict_helper(desc, row): | |||||||
|     "Returns a dictionary for the given cursor.description and result row." |     "Returns a dictionary for the given cursor.description and result row." | ||||||
|     return dict(zip([col[0] for col in desc], 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): | def dictfetchmany(cursor, number): | ||||||
|     "Returns a certain number of rows from a cursor as a dict" |     "Returns a certain number of rows from a cursor as a dict" | ||||||
|     desc = cursor.description |     desc = cursor.description | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user