[ZPT] zope3-dev proposal on changing implicitly calling

Steve Alexander steve at z3u.com
Wed Jul 23 20:30:48 EDT 2003



> If I have a path:
> /x/y/z
> ...where x and z are callables (and x needs to be called to get somethat 
> that y can be obtained from...) then what would the Zope 3 ZPT/TAL look 
> like to replace the contents of <i> with the result of calling z?

For Zope 3, that should depend what traversal components are set for 
traversing x and y and z.

If you say that x and z should be called, because it is their role in 
the application to be called when traversed, then the TALES expression is:

   root/x/y/z

However, let's say 'z' has a __call__ method, but you don't want it to 
be called when being traversed. Currently, you're stuck. It will always 
be called.

The point of my proposal is that Zope 3 cannot control this properly 
because the base TAL/TALES code always calls 'z' if it is callable.


>> Can you summarise what you think the vote would be for?
> 
> Well, Florent proposed that, if the above example, you'd write:
> 
> <i tal:contents="root/x/y/z"/>

That's what I'd like too.

> I don't yet know what your opion would be, but at the moment, I'm in 
> favour of Florent's

Ok. What about when 'z' should not be called?

--
Steve Alexander




More information about the ZPT mailing list