summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-11-09 11:40:23 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-11-09 11:40:23 -0500
commita41c50ad63f688cce99fdb9920c4f7c24ef0c866 (patch)
treed811319676606ce89642bf316499e101c785b974 /lib/sqlalchemy/engine
parent30bc42403754110df1fdec3037c7700cc4f26b70 (diff)
downloadsqlalchemy-a41c50ad63f688cce99fdb9920c4f7c24ef0c866.tar.gz
- Implemented sequence check capability for the C
version of RowProxy, as well as 2.7 style "collections.Sequence" registration for RowProxy. [ticket:1871]
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index ef402ceea..10b2b6782 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -2090,6 +2090,14 @@ class RowProxy(BaseRowProxy):
def itervalues(self):
return iter(self)
+try:
+ # Register RowProxy with Sequence,
+ # so sequence protocol is implemented
+ import collections
+ collections.Sequence.register(RowProxy)
+except ImportError:
+ pass
+
class ResultMetaData(object):
"""Handle cursor.description, applying additional info from an execution