[Zope] Using ZSQL Results in python: "dictionaries" property doesn't exist

Peter Sabaini sabaini@inode.at
Tue, 19 Feb 2002 20:29:19 +0100 (CET)


IIRC there are depending on Database Adapter different types of 
Results; some have a dictionaries() and some dont (sorry cant remember 
the details, you can figure out the supported methods/attributes with 
the aid of an External Method)

hasattr(r, 'colname') and/or getattr(r, 'colname', default) should 
work everywhere I think

hth peter.


On Tue, 19 Feb 2002, Igor Leturia wrote:

>   Hi all!
> 
>   I am trying to use the "Results" variable returned by any ZSQL method
> in a python script, as shown in this how-to:
> http://www.zope.org/Members/spinwing/ZSQL_Results . The thing is I can
> access Results.names() and Results.data_dictionary() as shown in the
> examples there, but not Results.dictionaries(). It says that the
> property doesn't exist.
> 
>   Any ideas?
> 
> 					Igor Leturia
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>