Django

Code

Changeset 3727

Show
Ignore:
Timestamp:
09/05/06 11:12:36 (2 years ago)
Author:
jacob
Message:

Made psycopg2 backend actually support dictfetch* methods.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/backends/postgresql_psycopg2/base.py

    r3675 r3727  
    6969    return '"%s"' % name 
    7070 
    71 def dictfetchone(cursor): 
    72     "Returns a row from the cursor as a dict" 
    73     # TODO: cursor.dictfetchone() doesn't exist in psycopg2, 
    74     # but no Django code uses this. Safe to remove? 
    75     return cursor.dictfetchone() 
    76  
    77 def dictfetchmany(cursor, number): 
    78     "Returns a certain number of rows from a cursor as a dict" 
    79     # TODO: cursor.dictfetchmany() doesn't exist in psycopg2, 
    80     # but no Django code uses this. Safe to remove? 
    81     return cursor.dictfetchmany(number) 
    82  
    83 def dictfetchall(cursor): 
    84     "Returns all rows from a cursor as a dict" 
    85     # TODO: cursor.dictfetchall() doesn't exist in psycopg2, 
    86     # but no Django code uses this. Safe to remove? 
    87     return cursor.dictfetchall() 
     71dictfetchone = util.dictfetchone 
     72dictfetchmany = util.dictfetchmany 
     73dictfetchall = util.dictfetchall 
    8874 
    8975def get_last_insert_id(cursor, table_name, pk_name):