[Zope] nested dtml-in

Evan Simpson evan@4-am.com
Mon, 10 Jan 2000 14:16:51 -0600


cesare@planningsrl.it wrote:

> <dtml-in Master>
>    <dtml-in "second(MasterCode='<dtml-sqlvar Master.Code>' type=String )">
>        <dtml-sqlvar Master.Code>    <dtml-sqlvar  Detail.Code>
> <dtml-sqlvar Detail.Description>
>    </dtml-in>
> </dtml-in>

Something like:

<dtml-in Master>
    <dtml-let theMaster=sequence-item>
        <dtml-in expr="Detail(MasterCode=theMaster.Code)">
<dtml-var expr="theMaster.Code"> <dtml-var Code>
<dtml-var Description>
        </dtml-in>
    </dtml-let>
</dtml-in>

is probably what you want.  Note that <dtml-sqlvar ...> is not meant for use
on the *results* of SQL Methods, it is used to *build* their queries.  You
don't need to qualify 'Code' and 'Description' in the inner loop, since they
are automatically looked up in the Detail record first.

Cheers,

Evan @ 4-am