[ZPT] Passing where clause to zsql method
Grant Thibdeau
miket@davisvision.com
Mon, 25 Mar 2002 16:10:10 -0800
My apologies if this is the wrong place to send this to, but here is my
issue. This is a beginner ZPT question so I'll give the whole process,
because I'm not entirely sure if I'm missing a concept here or I'm just
doing it completely wrong. I have my ZPT that calls a ZSQL Method which
gets a list of contact lenses from a SQL DB and renders it.
<tr tal:repeat="maker root/Lens123/Sql/sqlGetMaker">
<td><a href="Link"
tal:attributes="href NotSure/WheretoLink"
tal:content="maker/manufacturer"
bordercolor="#FFFFFF"
class="NavrBarTextSmall">American
Hydron</a></td>
</tr>
So the idea is to have a list of contact lens makers. This works, now what
I want to do, is go from my list of lens makers, to a list of actual lenses
by that maker. So my question now is, how do I pass a maker argument so I
can search for that specific maker? Do I pass it in the header? Add it as a
parameter to the PT? Where ever I look on the web, I can only find how to
do this in DTML and not ZPT. I understand how it would work if we're
taking text input from a form, but I don't want to take input from the
user, I need to make it a link. Then my second question comes up, where
should I actually make the link to? A python script that calls the zsql
method, or would I link to a page template which calls the zsql
method? Any suggestions would be appreciated or direction to a site that
has some info about this on it. Thanks for any time spared
-Grant