Changeset 5968
- Timestamp:
- 08/19/07 20:13:12 (1 year ago)
- Files:
-
- django/trunk/django/db/backends/ado_mssql/base.py (modified) (1 diff)
- django/trunk/django/db/backends/dummy/base.py (modified) (1 diff)
- django/trunk/django/db/backends/__init__.py (modified) (1 diff)
- django/trunk/django/db/backends/mysql/base.py (modified) (1 diff)
- django/trunk/django/db/backends/mysql_old/base.py (modified) (1 diff)
- django/trunk/django/db/backends/oracle/base.py (modified) (1 diff)
- django/trunk/django/db/backends/postgresql/base.py (modified) (1 diff)
- django/trunk/django/db/backends/postgresql_psycopg2/base.py (modified) (1 diff)
- django/trunk/django/db/backends/sqlite3/base.py (modified) (1 diff)
- django/trunk/django/db/backends/util.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/backends/ado_mssql/base.py
r5967 r5968 103 103 uses_case_insensitive_names = False 104 104 105 dictfetchone = util.dictfetchone106 105 dictfetchmany = util.dictfetchmany 107 106 dictfetchall = util.dictfetchall django/trunk/django/db/backends/dummy/base.py
r5967 r5968 40 40 supports_constraints = False 41 41 supports_tablespaces = False 42 dictfetchone = complain43 42 dictfetchmany = complain 44 43 dictfetchall = complain django/trunk/django/db/backends/__init__.py
r5967 r5968 5 5 # Import copy of _thread_local.py from Python 2.4 6 6 from django.utils._threading_local import local 7 8 def _dict_helper(desc, row): 9 "Returns a dictionary for the given cursor.description and result row." 10 return dict(zip([col[0] for col in desc], row)) 7 11 8 12 class BaseDatabaseWrapper(local): django/trunk/django/db/backends/mysql/base.py
r5967 r5968 185 185 uses_case_insensitive_names = False 186 186 187 dictfetchone = util.dictfetchone188 187 dictfetchmany = util.dictfetchmany 189 188 dictfetchall = util.dictfetchall django/trunk/django/db/backends/mysql_old/base.py
r5967 r5968 204 204 uses_case_insensitive_names = False 205 205 206 dictfetchone = util.dictfetchone207 206 dictfetchmany = util.dictfetchmany 208 207 dictfetchall = util.dictfetchall django/trunk/django/db/backends/oracle/base.py
r5967 r5968 225 225 return s 226 226 227 dictfetchone = util.dictfetchone228 227 dictfetchmany = util.dictfetchmany 229 228 dictfetchall = util.dictfetchall django/trunk/django/db/backends/postgresql/base.py
r5967 r5968 201 201 uses_case_insensitive_names = False 202 202 203 def dictfetchone(cursor):204 "Returns a row from the cursor as a dict"205 return cursor.dictfetchone()206 207 203 def dictfetchmany(cursor, number): 208 204 "Returns a certain number of rows from a cursor as a dict" django/trunk/django/db/backends/postgresql_psycopg2/base.py
r5967 r5968 164 164 uses_case_insensitive_names = False 165 165 166 dictfetchone = util.dictfetchone167 166 dictfetchmany = util.dictfetchmany 168 167 dictfetchall = util.dictfetchall django/trunk/django/db/backends/sqlite3/base.py
r5967 r5968 121 121 uses_case_insensitive_names = False 122 122 123 dictfetchone = util.dictfetchone124 123 dictfetchmany = util.dictfetchmany 125 124 dictfetchall = util.dictfetchall django/trunk/django/db/backends/util.py
r5609 r5968 134 134 return dict(zip([col[0] for col in desc], row)) 135 135 136 def dictfetchone(cursor):137 "Returns a row from the cursor as a dict"138 row = cursor.fetchone()139 if not row:140 return None141 return _dict_helper(cursor.description, row)142 143 136 def dictfetchmany(cursor, number): 144 137 "Returns a certain number of rows from a cursor as a dict"
