[Zope3-dev] path adapters
Jim Fulton
jim at zope.com
Mon Sep 12 09:23:28 EDT 2005
Jean-Marc Orliaguet wrote:
> Stephan Richter wrote:
>
>
>>On Sunday 11 September 2005 11:32, Jean-Marc Orliaguet wrote:
>>
>>
>>
>>>it there any technical reason why:
>>>
>>> tal:define="displayable nocall:context/displayable"
>>>
>>>could not return the adapted object based on the context instead of
>>>triggering a traversal error?
>>>
>>>
>>
>>Yes. You are not using the path adapter syntax as far as I can see. You need
>>to have: object/path_adapter_name:function
>>
>>You should check the parsing implementation (probably some traversing code) to
>>see about the assumptions.
>>
>>Regards,
>>Stephan
>>
>>
>
>
> I know that, I was about to file this as a bug, or write a proposal to let
>
> tal:define="adapted nocall:object/path_adapter_name"
>
> return the adapted object, but I found a workaround, by adding:
You both are off on the path adapter syntax. The syntax allows
the attribute name to be ommitted. You can write:
tal:define="adapted nocall:object/path_adapter_name:"
(note the trailing colon)
to get just the adapter. Note that the syntax:
ob/foo:bar
and
ob/foo:/bar
are equivalent.
This syntax is kinda silly, as pointed out in:
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/TALESPathExpressionAdapters
Unfortunately, because we could never agree on an alternate syntax, we're stuck
with the current syntax, at least for now.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list