diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-05-02 01:31:56 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-05-02 01:31:56 +0000 |
| commit | f69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch) | |
| tree | d3b32e84cd66573b3833ddf662af020f8ef2f7a8 /django/core/db/dicthelpers.py | |
| parent | d5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (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/dicthelpers.py')
| -rw-r--r-- | django/core/db/dicthelpers.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/django/core/db/dicthelpers.py b/django/core/db/dicthelpers.py deleted file mode 100644 index 5aedc51aed..0000000000 --- a/django/core/db/dicthelpers.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -Helper functions for dictfetch* for databases that don't natively support them. -""" - -def _dict_helper(desc, row): - "Returns a dictionary for the given cursor.description and result row." - return dict([(desc[col[0]][0], col[1]) for col in enumerate(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 - return [_dict_helper(desc, row) for row in cursor.fetchmany(number)] - -def dictfetchall(cursor): - "Returns all rows from a cursor as a dict" - desc = cursor.description - return [_dict_helper(desc, row) for row in cursor.fetchall()] |
