[Zope] Passing optional parameters to an Z SQL method.
Morten W. Petersen
mpeters@online.no
Fri, 15 Oct 1999 13:25:18 +0200
I've got an Z SQL method that has the arguments locatestring:string
and created_after, created_before, lastmod_after, lastmod_before.
Now, in the SQL method, I've got the usual stuff;
SELECT
bleh.id
bleh.title
FROM
bleh
WHERE
LOCATE(<!--#sqlvar locatestring-->,bleh.title)
<!--#if created_after-->
AND
bleh.created > <!--#sqlvar created_after type=int-->
AND
bleh.created < <!--#sqlvar created_before type=int-->
AND
bleh.lastmod > <!--#sqlvar lastmod_after type=int-->
AND
bleh.lastmod < <!--#sqlvar lastmod_before type=int-->
<!--#/if-->
This works perfectly when I perform the query through the test
interface, however, it chokes when I use it from a DTML
document, saying it can't find the created_* and lastmod_*
variables in REQUEST. Any alternative ways to perform this?
Also, are there som utilities for parsing *a lot* of Z SQL
methods/DTML documents for strings, and then replacing them?
-Thanks in advance
--
------------------------------------------------------------
"One World, One Web, One Program" - Microsoft Promotional Ad
"Ein Volk, Ein Reich, Ein Fuhrer" - Adolf Hitler
------------------------------------------------------------