[PyGreSQL] DictCursor support for 3.8.1
D'Arcy J.M. Cain
darcy at PyGreSQL.org
Thu Sep 21 11:15:13 EDT 2006
Sorry about that last, content-free message. Hit send by accident.
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 attached the final proposed patch. Is it possible to get a unit
test added to TEST_PyGreSQL_dbapi20.py as well? If you can describe
the use case I will try to create the unit test myself.
--
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: 1531 bytes
Desc: not available
Url : http://mailman.vex.net/pipermail/pygresql/attachments/20060921/0d9fd406/attachment.obj
More information about the PyGreSQL
mailing list