[Zope] passing variable to dtml method -> sqlmethod

Tony McDonald tony.mcdonald@ncl.ac.uk
Fri, 23 Aug 2002 13:47:46 +0100


On 23/8/02 2:18 am, "zopelist@robertson.net.nz" <zopelist@robertson.net.nz>
wrote:

> Greetings. I have a Z SQL Method that calls a select statement like so:
> 
> select * from chart
> where <dtml-sqltest link op=eq type=nb optional multiple>
> 
> I am calling this from a DTML method that formats the results.
> 
> I need to call the method several times on a page, passing different
> values for link.
> I can send a value from the DTML method to the SQL method, but cannot work
> out how to send it from the dtml page.
> Do I have to start writing scripts here?
> 
> Help appreciated.
> 
> Don
> 

Not sure I've got it, but this might work (untested)

<dtml-in "['link1', 'link2', 'link3']" prefix=my_link>

<dtml-in "SQL(link=my_link_item)">
Formatting....
</dtml-in>

</dtml-in>

So no, no scripts needed - but they don't bite :)

Hth
Tone
-- 
Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 243 6140
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope