From 732074541a17cde1d6d634007949d8a8c83cdc1a Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 17 Mar 2008 14:15:15 +0000 Subject: [PATCH] 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 --- django/db/backends/postgresql/base.py | 3 +++ django/db/backends/util.py | 3 +++ 2 files changed, 6 insertions(+) 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 # ###############################################