[egenix-users] Converting ZQL method return value to dictionary
Jerry Westrick
Jerry at Westrick.Com
Sun Aug 10 12:38:00 CEST 2003
Hello:
I'm not sure if this is the right list, if not sorry.
I'm trying to convert the result of a Zql method into a dictionary.
the code I'm using is:
# Get User Info
for row in context.Get_UserInfo(user=request.AUTHENTICATED_USER):
values['user'] = row
The Get_UserInfo is a Z SQL Method, returning a single row
from a mxODBC conneciton.
when I executed the following lines:
print values['user']
return printed
I get
<r instance at 8d8f130>
I would to convert this r instance to a dictionary, so I can add/modify
values in it like the following:
values['user']['justforfun'] = 'Additional info not from select!'
which at the moment gives me:
Error Type: TypeError
Error Value: object does not support item or slice assignment
Now to my questions:
1) the class "r", is it a Zope thingy or a mxODBC thingy?
2) is there a mothod to do what I need?
Than you for your time...
Jerry
P.S. There are other dictionary functions not support by this "R"
instance that I would like to use also...
More information about the egenix-users
mailing list