[DB-SIG] fetchone -> dictionary?

Stephen Ng stephenng@my-dejanews.com
Thu, 21 Jan 1999 23:30:09 -0000


Thanks for the pointers but I haven't been able to locate dtuple.py (I searched the website and newsgroups at http://www.python.org/search/).

Can someone point me to it or email it to me?

Thanks,

Steve
 
--

On Wed, 20 Jan 1999 16:48:52   Bill Tutt wrote:
>
>
>From: Greg Stein [mailto:gstein@lyra.org]
>> 
>> 
>> Suggestions like these have come up in the past. The reason that a
>> simple tuple is returned is that it is much easier for the module
>> implementor. Rather than requiring all module implementors to 
>> deal with
>> more complex data structures, we rely on Python itself to do the work.
>> You can write a simple layer over the cursor object that fills in a
>> dictionary based on the cursor.description results plus the returned
>> tuple. If you check the archives, you'll find a solution that I posted
>> called "dtuple.py" that can wrap a tuple into a lightweight object
>> allowing "row.FieldName" types of access. It may also allow the
>> dict-type access that you describe, but I've forgotton.
>> 
>
>dtuple.py indeed does allow a read-only dict-type access to the data.
>If you can't dig it up in the archives, I know I have a copy here someplace.
>I think I may have posted a cursor wrapper object that used dtuple as well,
>but can't recall for sure.
>
>Bill
>
>


-----== Sent via Deja News, The Discussion Network ==-----
http://www.dejanews.com/  Easy access to 50,000+ discussion forums