31 May
2002
31 May
'02
8 a.m.
Hello, I want to add a ZPT at initialization (in the __init__ method) of my folderish product. Why can't I just use: self.manage_addPageTemplate(id='ZPTid',title='title',text='content') Can someone give me the right syntax to do this? I've tried the following, but aq_parent doesn't exists at initialization of your product (thanks Casey): parent = getattr(self, 'aq_parent', None) self._createZPT(parent, 'ZPTidentity', 'title', 'Template') def _createZPT(self, parent, id, title, content): """Add a PageTemplate to the News product""" parent._setObject(id, ZopePageTemplate.ZopePageTemplate(id, text=content)) getattr(parent, id).pt_setTitle(title) Greetz Nico