mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +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>
|
||||
|
||||
* psycopg/typecast_array.c (typecast_array_tokenize): removed cast
|
||||
|
|
|
@ -76,7 +76,14 @@ class DictCursor(_cursor):
|
|||
if self.__query_executed:
|
||||
self._build_index()
|
||||
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):
|
||||
"""A row object that allow by-colun-name access to data."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user