[Zope] dtml syntax help needed

Kelley, Sean SKelley@ci.santa-rosa.ca.us
Wed, 25 Jun 2003 16:07:27 -0700


Hi,
I am returning a list of records from a zsql method with dtml-in
I want to query another zsql method during each iteration of the outer
dtml-in to get a value from another database based on the login just
displayed in the first dtml-in
(at least this is how I think it would go from a dtml standpoint)

I have one database which displays user names based on some search
parameter.  I would then like to query a second database to get the actual
name of the person to display below their user name.  My first attempt
showed all of the users listed and then only one of the user names had an
associated real name...I think this was because I was getting the very last
match to login in the second database, not one matches for each iteration of
the in loop

<dtml-in AssetList size=20 start=query_start>
...
<dtml-var LOGIN null="Not Listed">
        <dtml-in "emp_lookup()">
           &dtml-first;
           &dtml-last;
        </dtml-in>
...
</dtml-in>

emp_lookup looks like:

select Firstname as first, Lastname as last
from employees
where login= '<dtml-var LOGIN>'

Any ideas on how to do this syntactically?