mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
DictCursor now support iteration.
This commit is contained in:
parent
559149824b
commit
27a063fecb
|
@ -1,3 +1,7 @@
|
||||||
|
2006-03-08 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
|
* lib/extras.py: added .next() to DictCursot to support iteration.
|
||||||
|
|
||||||
2006-03-02 Federico Di Gregorio <fog@initd.org>
|
2006-03-02 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
* psycopg/typecast_array.c (typecast_array_tokenize): removed cast
|
* psycopg/typecast_array.c (typecast_array_tokenize): removed cast
|
||||||
|
|
|
@ -77,6 +77,13 @@ class DictCursor(_cursor):
|
||||||
self._build_index()
|
self._build_index()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
res = _cursor.fetchone(self)
|
||||||
|
if res is None:
|
||||||
|
raise StopIteration()
|
||||||
|
if self.__query_executed:
|
||||||
|
self._build_index()
|
||||||
|
return res
|
||||||
|
|
||||||
class DictRow(list):
|
class DictRow(list):
|
||||||
"""A row object that allow by-colun-name access to data."""
|
"""A row object that allow by-colun-name access to data."""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user