[Zope-DB] how to fetch and set a value from a result object

Robert Van Overmeiren vanoverr@uniteddrugs.com
Thu, 12 Dec 2002 12:31:24 -0700


Hello,

I would like to know how to interate over a Z SQL Method result object,
which returns a single unique result, and set a variable's value to this
unique result within a python external method.

My query is passed a username and it selects the latest login time for the
username. I tried this:

timestamp = context.select_log_time(username=Username)

but 'timestamp' gets set to the result object rather than just the unique
value within it.

When this 'timestamp' value is returned to an HTML page, it displays:

<Shared.DC.ZRDB.Results.Results instance at 0x8f7dd24>

Can the value within the result object be 'fetched' and set to a variable
from within the python script?

Thanks,
Bob V