summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-04-11 07:20:46 +0000
committerFederico Di Gregorio <fog@initd.org>2005-04-11 07:20:46 +0000
commit10dc03462bcdda0a557194c4be5a9ce9281e574e (patch)
tree7b70184f3afa92f9690bec9e80d9067f2d4fead7
parent48d8bd39a1be26c436adc9413011dec899f955ae (diff)
downloadpsycopg2-10dc03462bcdda0a557194c4be5a9ce9281e574e.tar.gz
Little improvements to DictRow.
-rw-r--r--ChangeLog2
-rw-r--r--lib/extras.py6
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bef497..e1f6c39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@
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
Jason Erickson fixed segfaults due to calling Python function
without holding the GIL.
diff --git a/lib/extras.py b/lib/extras.py
index 2357447..7be08a6 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -70,6 +70,12 @@ class DictRow(list):
x = self._cursor.index[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):