MySQLdb where's fetchoneDict()?

Gerhard Häring gh_pythonlist at gmx.de
Sun Sep 30 09:27:19 EDT 2001


On Sun, Sep 30, 2001 at 02:44:05PM +0200, Gerhard Häring wrote:
> [...] 
> I'd probably subclass the cursor class to have the desired behaviour, i.
> e. a fetchoneDict() method that only uses stuff from the DB-API. That's
> not too difficult, it would only involve cursor.fetchone() and
> cursor.description. Then you'd need to subclass the Connection class to
> return an instance of your subclassed Cursor class instead.

Ugh. In reality, this gets uglier than I thought. Which probably means
that the idea wasn't really that good.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010930/d39a35da/attachment.sig>


More information about the Python-list mailing list