Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made psycopg2 backend actually support dictfetch* methods.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3727 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6152b325aa696a54041606332bdcaf6b163d129e 1 parent 6f87b17
Jacob Kaplan-Moss authored September 05, 2006
20  django/db/backends/postgresql_psycopg2/base.py
@@ -68,23 +68,9 @@ def quote_name(name):
68 68
         return name # Quoting once is enough.
69 69
     return '"%s"' % name
70 70
 
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()
  71
+dictfetchone = util.dictfetchone
  72
+dictfetchmany = util.dictfetchmany
  73
+dictfetchall = util.dictfetchall
88 74
 
89 75
 def get_last_insert_id(cursor, table_name, pk_name):
90 76
     cursor.execute("SELECT CURRVAL('\"%s_%s_seq\"')" % (table_name, pk_name))

0 notes on commit 6152b32

Please sign in to comment.
Something went wrong with that request. Please try again.