[ZPT] Re: [Zope-CMF] Visibility of global variables

Tres Seaver tseaver@zope.com
15 Oct 2002 10:52:32 -0400


On Tue, 2002-10-15 at 09:29, Andreas Jung wrote:
> Inside a ZPT I have something like:
> 
> <html...>
> <span tal:define="global is_allowed python: here.is_allowed()" />
> 
> <div metal:fill-slot="main">
> 
>   <div tal:condition="is_allowed"> ....
> 
> 
> This fails with "Undefined, is_allowed is not found in 'is_allowed'".
> 
> Bug or feature?

AFAIK, global names are defined in the scope of the template which
includes the macro;  the "source" template for the macro is not itself
"evaluated" before inclusion (METAL processing is done *before* TAL
processing).

CC'ing the zpt@zope.org list, where any further discussion belongs.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com