[Zope] How to correctly use the PARENTS object?

Peter Sabaini sabaini@niil.at
Mon, 23 Apr 2001 11:26:18 +0200 (CEST)


I'm not sure myself how to use the PARENTS object myself, but I think
you rather want to use the dtml-with tag. dtml-with tells Zope to
"look somewhere else" for a name.

Eg. something like this should work:

<dtml-with Bugsmail>
  <dtml-getRecipients>
   ...
  </dtml-in>
</dtml-with>

Hth,
peter.

On Mon, 23 Apr 2001, Gerrie Roos wrote:

> I've struggled with this long enough to justify asking help...I've been
> through the manuals, FAQ's etc, but somehow my understanding of PARENTS
> object is incomplete...
>
> I have the following directory structure:
>
> Bugs
>         Interface
>                 Insert
>                         sendMail - a DTML Document
>                 BugsMail
>                         getRecipients - a Z SQL Method
>
> I'd like to call and iterate over the results of getRecipients from
> sendMail.  So I tried the following in sendMail:
>
> <dtml-in PARENTS[1].BugsMail.getRecipients>
>         <dtml-var someFieldReturnedByGetRecipients>
> </dtml-in>
>
> ...and I get a KeyError for PARENTS[1].BugsMail.getRecipients....
>
> I tried various other options (albeit somewhat blindly/desparately), eg.
> putting the whole PARENTS thing in an expression, etc...What am I
> missing?
>
> What other options are there to traverse a path in a dtml-statement, or
> to do what I want to do here?
>
> Please help, I'm pretty new to this...


-- 

_________________________________________________
peter sabaini, mailto: sabaini@niil.at
-------------------------------------------------