[Zope3-dev] Re: RFC: The browser:page compromise

Philipp von Weitershausen philipp at weitershausen.de
Sat Apr 22 09:24:58 EDT 2006


dev at projekt01.ch wrote:
>> I think viewlets and contentproviders should have taken the 
>> same road and used traversal namespaces. That's what they're for :).
> 
> I don't think so.
> ITALESExpression are built for this use case.

I doubt that they were designed to *look up* things. They're
expressions, that means you enter some form of expression and the engine
will resolve the expression. Look at the expression types we had originally:

* path (resolve a/path/like/that)
* string (string ${templating})
* python (evaluate Python code)

In other words, TALES expressions *evaluate* some form of expression
(perhaps even regular expression, SQL, whatever). But using them to
*look up* something seems like abuse to me.

> My context doesn't need to have a ++macro++ namespace!

It has ++view++, ++vh++, etc. namespaces. Why can't it have that namespace?

> My context doesn't know about macros and viewlets.

Right. No one is expecting that. That's exactly what adapters are for.
Your context doesn't know about absolute URLs either, but yet we can say
context/@@absolute_url.

> Macros or viewlets
> depend on context and request. This is the reason why we implemented a 
> lookup via tales expression and not a traversal namespace on our context.

That's not a reason. Traversal namespaces also take context and request.
Lots of things take context and request.

Philipp


More information about the Zope3-dev mailing list