summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-17 14:15:15 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-17 14:15:15 +0000
commit732074541a17cde1d6d634007949d8a8c83cdc1a (patch)
tree6671b8884acad62ee25a60acbb399caa6856b520
parent50ecd7537909915bc5faed644817a58c0a1f765e (diff)
Fixed #5883 -- Added __iter__ methods to the debug cursor and the postgresql backend cursor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/backends/postgresql/base.py3
-rw-r--r--django/db/backends/util.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index c8b87c2dd1..1dfe34aceb 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -56,6 +56,9 @@ class UnicodeCursorWrapper(object):
else:
return getattr(self.cursor, attr)
+ def __iter__(self):
+ return iter(self.cursor)
+
class DatabaseFeatures(BaseDatabaseFeatures):
pass # This backend uses all the defaults.
diff --git a/django/db/backends/util.py b/django/db/backends/util.py
index ca4e90d6c2..367072879e 100644
--- a/django/db/backends/util.py
+++ b/django/db/backends/util.py
@@ -41,6 +41,9 @@ class CursorDebugWrapper(object):
else:
return getattr(self.cursor, attr)
+ def __iter__(self):
+ return iter(self.cursor)
+
###############################################
# Converters from database (string) to Python #
###############################################