[zope2-tracker] [Bug 377948] Re: Inconsistent access to macros of page templates

Patrick Gerken do3ccqrv at googlemail.com
Wed May 20 05:00:04 EDT 2009

I was expecting that the browser view, if configured without a class but only a template, could work as a drop in replacement for a page template that resides in zodb. But it currently is not, or only half baked.
It is possible to retrieve the macros directly, but only if you try to access it like an element of a dictionary.
So a tal Expression can retrieve the macros from a page template and browser view, since it will try both attribute access and dictionary access. But in code, you can not write code that works transparanently with both browser views and page templates. Either you can only access macros as a dictionary item only, or as an attribute only. 

Look here for an example:

It is easy to make this code look up a browser view page template. But
then it breaks because it assumes that the template has an attribute
macros. There is currently no way to access the macros in a way that you
can transparently replace the Browser View with a page template in zodb.
And this is the bug, imho. Now I don't know who is wrong and who is

Inconsistent access to macros of page templates
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.

More information about the zope2-tracker mailing list