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 # ###############################################