[z3-five] (re)using zpt macros from view page templates

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Mon Jan 29 10:52:00 CET 2007


>
>> Isn't it sufficient to register the template through ZCML?
>>     
> ...then we're looking at least at an adapter looking, probably some 
> security checks in the traversal, and who knows what else.
>   
Even default zope skins are views that consist
of other views (zope.app.basicskin.standardmacros).

> Is there anything wrong with just having the page template as a 
> module-level global and importing from there?
And what about base view like:

class MyBaseView(BrowserView):
    my_macro = ZopeTwoPageTemplateFile('macros.pt')

class MyView(MyBaseView):

     def getMacro(self):
         return self.my_macro.macros['template']


-- 
Maciej Wisniowski


More information about the z3-five mailing list