[Zope] Z SQL row to dictionary

Jerry Westrick Jerry at Westrick.Com
Sun Aug 10 11:20:50 EDT 2003


Ah...  that is exactly what I wanted but......

with the following code:


# Get User Info
for row in context.Get_UserInfo(user=request.AUTHENTICATED_USER):
    values['user'] = row.dictionary()

print values['user']
return printed

I get an error:

Error Type: AttributeError
Error Value: dictionary



Ditto for dictionaries()






On Sun, 2003-08-10 at 00:34, Kevin Carlson wrote:
> This one is pretty straightforward.  You can turn a ZSQL result set into 
> a list of dictionaries simply by calling the dictionaries() method on 
> the result set.
> 
> For example:
> 
> results = ZSQLMethod.getSomethingFromDB()
> dicts = results.dictionaries()
> 
> Hope that helps,
> 
> Kevin
> 
> Jerry Westrick wrote:
> 
> >Hello...
> >
> >anybody know how to convert the row returned from
> >an Z SQL into a dictionary?
> >
> >Jerry
> >
> >
> >_______________________________________________
> >Zope maillist  -  Zope at zope.org
> >http://mail.zope.org/mailman/listinfo/zope
> >**   No cross posts or HTML encoding!  **
> >(Related lists - 
> > http://mail.zope.org/mailman/listinfo/zope-announce
> > http://mail.zope.org/mailman/listinfo/zope-dev )
> >
> >  
> >
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 




More information about the Zope mailing list