[Zope] Not grocking RESQUEST.set syntax
Ender
kthangavelu@earthlink.net
Wed, 25 Oct 2000 10:29:55 -0700
Noah wrote:
>
> I'm still not grocking the syntax for setting REQUEST fields.
> I want to set a REQUEST field "filename" to be the value returned
> by a ZSQL call. I want something like this (pseudo-code of what I want):
>
> <dtml-let FOO=MyFavoiteZSQLMethod>
> <dtml-call "REQUEST.set('filename', FOO)">
> <dtml-call some_other_thing_that_uses_filename>
> </dtml-let>
>
> That does not work because FOO gets set to something like:
> <Shared.DC.ZRDB.Results.Results instance at 7760b0>
> I tried sticking this inside <dtml-in><dtml-in> to get
> at the sequence-item, but I just ended up getting confused.
thats because you're working on the results returned by a zsql method
which is a result object, you want access to values within it.
try
<dtml-call "REQUEST.set('filenames',
MyFavoriteZSQLMethod(REQUEST).dictionaries())">
this returns the list of dictionaries that represent rows in the table,
with column names as keys and column values as values.
you can reference
lib/python/Shared/DC/ZRDB/Results.py
for more info on the results object
kapil