MySQLdb where's fetchoneDict()?

Gabriel Ambuehl gabriel_ambuehl at buz.ch
Mon Oct 1 10:33:44 CEST 2001


-----BEGIN PGP SIGNED MESSAGE-----

Hello Gerhard,

Sunday, September 30, 2001, 2:44:05 PM, you wrote:
>> AARGH. That means I can go and rewrite 2000 lines of code. (I
>> wouldn't mean not being portable...)

> I think it's classified as "deprecated" because it's nonstandard.

Ah then its ok. Some people use deprecated synonymous to "ain't here
any more cause it's bad" or "will go away in future cause it's bad".

> I don't think you have to replace all fetchoneDict() with
> fetchone() and ugly integer indices.

Using cursorclass=MySQLdb.cursors.DictCursor helps but now the
fetchone() / fetchall() methods return Dicts too which isn't really
what's wanted cause in case of a "SELECT one_field FROM some_table"
I'd normally use string=db.fetchone() which now breaks.

Best regards,
 Gabriel


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5i

iQEVAwUBO7gcW8Za2WpymlDxAQEubQf/XzxocofiN/xKPROzuWYLux3R/5KqA4u+
RXKB6rXPyZyx9bThyzlMfNuDaOg7hIkxxIJa3rhBEnUwqtPCfFUIPRfon8juYeZN
tUSXt9bfu4CPCMpHWiXPs8HjaXIjFfa6E/E56QA2vG9plogb82AoqYgWi7vIVH5c
0NSkGkcp3YVIhlhNRI0YyE7ze55qzLJg7kbdeAxA3kSII2Xtuf5vhLEehHMl/Obi
yJ3SUznRgq8U0rxlfr8ASMCEQFpynPdIMNn2XkXJcRszfIPp0IRfmVXqWYXDfeS+
/hUOMlmymX5H8evKaOGs6Ayh9ihrgwMIonoBwqAXRRTGh3hE/eGqiQ==
=vgnL
-----END PGP SIGNATURE-----





More information about the Python-list mailing list