[ZPT] zope3-dev proposal on changing implicitly calling
Florent Guillaume
fg at nuxeo.com
Thu Jul 24 15:44:29 EDT 2003
Steve Alexander wrote:
>> 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?
TALES has nocall: already, I'm not sure it's very elegant though...
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg at nuxeo.com
More information about the ZPT
mailing list