summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-05-10 02:29:24 +0000
committerFederico Di Gregorio <fog@initd.org>2005-05-10 02:29:24 +0000
commit35c42310ec14722ddf5c888cff33e5ff3b958da1 (patch)
tree0481434ec35498a9a6494fce1eba42a162770ead /lib/extras.py
parentd57ceaadc6c964ed9fe58a586dff8ec2528e1789 (diff)
downloadpsycopg2-35c42310ec14722ddf5c888cff33e5ff3b958da1.tar.gz
DictRow fixes.
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 3e264a0..a494d8a 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -62,22 +62,22 @@ class DictRow(list):
"""A row object that allow by-colun-name access to data."""
def __init__(self, cursor):
- self._cursor = cursor
+ self._index = cursor.index
self[:] = [None] * len(cursor.description)
def __getitem__(self, x):
if type(x) != int:
- x = self._cursor.index[x]
+ x = self._index[x]
return list.__getitem__(self, x)
def items(self):
res = []
- for n, v in self._cursor.index.items():
+ for n, v in self._index.items():
res.append((n, list.__getitem__(self, v)))
return res
def keys(self):
- return self._cursor.index.keys()
+ return self._index.keys()