Little improvements to DictRow.

This commit is contained in:
Federico Di Gregorio 2005-04-11 07:20:46 +00:00
parent 48d8bd39a1
commit 10dc03462b
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,8 @@
2005-03-29 Federico Di Gregorio <fog@debian.org> 2005-03-29 Federico Di Gregorio <fog@debian.org>
* Applied patch to fix tuple count.
* psycopg/pqpath.c (pq_is_busy): Staring from bug report from * psycopg/pqpath.c (pq_is_busy): Staring from bug report from
Jason Erickson fixed segfaults due to calling Python function Jason Erickson fixed segfaults due to calling Python function
without holding the GIL. without holding the GIL.

View File

@ -70,6 +70,12 @@ class DictRow(list):
x = self._cursor.index[x] x = self._cursor.index[x]
return list.__getitem__(self, x) return list.__getitem__(self, x)
def items(self):
res = []
for n, v in self._cursor.index.items():
res.append((n, list.__getitem__(self, v)))
return res
class SQL_IN(object): class SQL_IN(object):