[Zope] Strange behavior with TAL and python: expressions

Dieter Maurer dieter at handshake.de
Sat Apr 1 04:26:02 EST 2006


Floyd May wrote at 2006-3-30 10:06 -0600:
> ...
> Within the macro, the 'form' variable
>(which is an FSForm object) is defined as None unless I access it
>using python expressions.

Path expressions essentially use "restrictedTraverse" to locate
the object identified by the path.
This *IS* different from a sequence of attribute lookups
in a Python expression.

Do you get "None", when you use "restrictedTraverse" in
the Python expression?


Of course, this does not apply to direct "variable" access
but only non trivial paths.

With respect to "variable" access, both path and python expressions
essentially use the same namespace (that of python expressions
is a bit larger, but the names defined there have lower priority
than that of the namespace part shared with path expressions).

-- 
Dieter


More information about the Zope mailing list