[Zope] Z SQL row to dictionary

Jerry Westrick Jerry at Westrick.Com
Sun Aug 10 12:57:13 EDT 2003


Thanky you everybody....

I finally got it...

I'll explain it here (maybe someone is as silly as I am
and this'll help)


Point 1: Z SQL Method returns a result set.
Point 2: a result set, has a ".dictionaries()" method
Point 3: The result set, contains a list of (instances of r)
Point 4: an instance of r does NOT have a .dictionaries() nor 
         anything similar!

so insead of 

for row in (context.Get_Template(...)):
   values[row['username']] = row.dictionary()

I need to use:

result = context.Get_Template(...)
for row in (result.dictionaries())
    values[row['username']] = row


Took a while but I finally got it!

Jerry

P.S.  Thanks again for all your patience and help...


On Sat, 2003-08-09 at 01:30, 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 )
> 




More information about the Zope mailing list