[Zope-dev] ZPT in Zope Products

Clemens Robbenhaar robbenhaar at espresto.com
Thu Apr 15 11:16:05 EDT 2004


Hi Wyatt,

 > from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 >  
 > def manage_addMyContainerForm(self, REQUEST):
 >       pt = None
 > if self.meta_type in ['ContainerType1', 'ContainerType2']:
 >             pt = PageTemplateFile('zpt/addMyContainerForm', globals())
 >       else:
 >             pt = PageTemplateFile('zpt/containerError', globals())
 >       return pt.pt_render()

I guess the problem is that the page template file is called without
acquision context. Usually a page template file is a class attribute of
a class which knows about acquisition.

You could mange in the right context via 

 return pt.__of__(self).pt_render()

but I am not sure if this will fly.

Cheers,
Clemens



More information about the Zope-Dev mailing list