[PyGreSQL] DictCursor support for 3.8.1
D'Arcy J.M. Cain
darcy at PyGreSQL.org
Tue Sep 19 21:01:42 EDT 2006
On Tue, 19 Sep 2006 13:20:56 -0400
"D'Arcy J.M. Cain" <darcy at PyGreSQL.org> wrote:
> In fact, let's make your comment a docstring:
>
> def row_factory(cur, row):
> """you can overwrite this with a custom row factory
> e.g. a dict_factory
>
> cursor = pgdbCursor(src, cache)
> def cursor.row_factory(caller, row):
> d = {}
> for idx, col in enumerate(caller.description):
> d[col[0]] = row[idx]
> return d
> """
> return row
I have further simplified your patch. See attached.
Just one more thing - do you have a unit test? Add it to the file
TEST_PyGreSQL_dbapi20.py in the same directory.
Thanks.
--
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgdb.py.diff.dc
Type: application/octet-stream
Size: 1018 bytes
Desc: not available
Url : http://mailman.vex.net/pipermail/pygresql/attachments/20060919/fce4702e/attachment.obj
More information about the PyGreSQL
mailing list