[Zope-DB] dtml-sqlgroup oddity

Cliff Ford Cliff.Ford at ed.ac.uk
Fri Nov 5 04:28:18 EST 2004


A wee test reveals that this format:

<dtml-sqltest column="Forenames" name="ForenameParam" op="eq" type=nb 
multiple optional>

omits the clause instead of testing against a null string.

Cliff

Philip Kilner wrote:
> Hi All,
> 
> I've been happily using the <dtml-sqlgroup> tag, but I now have a method 
> where all parameters are passed, whether supplied or not. The code is: -
> 
> select * from V_CANDIDATE_REGISTRATION
> <dtml-sqlgroup where>
>     <dtml-sqltest column="Forenames" name="ForenameParam" op="like" 
> type="string" optional>
>   <dtml-and>
>     <dtml-sqltest column="Surname" name="SurnameParam" op="like" 
> type="string" optional>
>   <dtml-and>
>     <dtml-sqltest column="CentreCandidateRef" name="CtrCandRef" op="eq" 
> type="string" optional>
> </dtml-sqlgroup>
> order by RegistrationID desc
> 
> The fails unless all parameters are supplied, because it is testing 
> against an empty string for missing parameters.
> 
> I'm assuming that I've made a typo or otherwise done something else 
> subtle - can anyone spot what's wrong?
> 
> 


More information about the Zope-DB mailing list