[Zope] ZPT/ZSQL optional where problems

Wayne Connolly wayne@c-media.com.au
Mon, 28 Jul 2003 23:29:59 -0700 (PDT)


Hi I have a form that i wish to do the following:
1.submit to itself (no probs here)
2.allow multiple optional criteria in form
3. render results(no probs here)


It doesnt seem to work and just returns all cats and
dogs instead of doing the correct filters.

Below is the form and sql method..i cant see whats
wrong.

ZPT: index_html
--------------
<FORM name="form1" method="post" action="index_html">
          <SELECT name="cat">
		  <OPTION>Select a cat</OPTION>
          <OPTION tal:repeat="cat
here/animalBrowseMethod"><SPAN
tal:replace="animal/cat">cat</SPAN></OPTION>
        </SELECT>
        <SELECT name="dog">
		  <OPTION>Select a dog</OPTION>
          <OPTION tal:repeat="dog
here/animalBrowseMethod"> <SPAN
tal:replace="animal/dog">dog</SPAN></OPTION>
        </SELECT>
        <INPUT type="submit" name="submit" value="Get
animals">
</FORM>
---------------
ZSQL: animalBrowseMethod
--------------------
select * from animal 
<dtml-sqlgroup optional where>
<dtml-sqlgroup>
<dtml-sqltest cat column=cat type=nb multiple
optional>
<dtml-or>
<dtml-sqltest dog column=dog type=nb multiple
optional>
</dtml-sqlgroup>
</dtml-sqlgroup>
----------------


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com