[Zope] <dtml-var foo> vs. <dtml-var expr="foo()">
Small Business Services
toolkit at magma.ca
Tue Jan 20 09:54:27 EST 2004
if your path is fixed try:
<dtml-with Path>
<dtml-with to>
<dtml-with my>
<dtml-var bar>
</dtml-with>
</dtml-with>
</dtml-with>
Jonathan
----- Original Message -----
From: "Juho Vuori" <juho.vuori at kepa.fi>
To: <zope at zope.org>
Sent: January 20, 2004 9:26 AM
Subject: [Zope] <dtml-var foo> vs. <dtml-var expr="foo()">
> A newbieish question. I thought <dtml-var foo> and <dtml-var
> expr="foo()"> were the same thing. Seems they are not: Depending on the
> way foo is called something differs in the environment they run in.
>
> Given the following situation:
>
> I have an dtml-method foo =
> <dtml-var bar>
>
> And dtml-method bar
> <dtml-var baz>
>
> Plus a third method baz
> <p>Pazaa!</p>
>
> Now viewing foo does exactly what you think it does: It goes calls bar
> which calls baz which returns the text <p>Pazaa!</p>
>
> Now change the first method foo:
> <dtml-var expr="bar()">
>
> And you'll get KeyError: baz
>
> Does somebody understand what is going on?
>
> My real-world situation is that I need to specify a path, which as far
> as I know forces me to use the expr="Pat.to.my.bar()" alternative. Or
> does it not?
>
> Juho Vuori
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list