Hi all, I would like to know if it's possible to have this patch accepted
(against current trunk):
Index: test/query.py
===================================================================
--- test/query.py (revision 1064)
+++ test/query.py (working copy)
@@ -170,6 +170,11 @@
r = self.users.select().execute().fetchone()
self.assertEqual(r.keys(), ['user_id', 'user_name'])
+ def test_items(self):
+ self.users.insert().execute(user_id=1, user_name='foo')
+ r = self.users.select().execute().fetchone()
+ self.assertEqual(r.items(), [('user_id', 1), ('user_name', 'foo')])
+
def test_len(self):
self.users.insert().execute(user_id=1, user_name='foo')
r = self.users.select().execute().fetchone()
Index: lib/sqlalchemy/engine.py
===================================================================
--- lib/sqlalchemy/engine.py (revision 1064)
+++ lib/sqlalchemy/engine.py (working copy)
@@ -705,6 +705,8 @@
return self.__parent._get_col(self.__row, name)
except:
raise AttributeError
+ def items(self):
+ return [(key, getattr(self, key)) for key in self.keys()]
def keys(self):
return self.__parent.keys
def values(self):
Thanks for the answers.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users