[Zope] problem using manage_addPageTemplate

Roché Compaan roche at upfrontsystems.co.za
Fri Jul 2 13:04:48 EDT 2004


* Stéphane MOLINA <stephane.molina at enst.fr> [2004-07-01 16:50]:
> 
> Hello,
> 
> I have some problem using manage_addPageTemplate :
> 
> I use it in my object constructor, :
> 
> class UserManager(Folder, Persistent, RoleManager, Item, ):
>     """
>     A user manager : simple user dictionnary
>     """
>     security = AccessControl.ClassSecurityInfo()
>     security.declareObjectPublic()
> 
>     meta_type = 'UserManager'
> 
>     def __init__(self, id):
>         self.id = id
>         self.manage_addUserFolder()
>         self.manage_addProduct['PageTemplates'].manage_addPageTemplate("usermanager_properties_form", "edit", "zpt/usermanager_properties_form.zpt")
>         self.manage_addProduct['PageTemplates'].manage_addScript("usermanager_properties", "edit", "zpt/usermanager_properties.py")
> 
> I get this error :
> 
> Site Error
> 
> An error was encountered while publishing this resource.
> 
> Error Type: AttributeError
> Error Value: _getProducts

Your instance is not acquisition wrapped during __init__ and the
ProductDispatcher needs to acquire '_getProducts'. Use manage_afterAdd
to do setup stuff like that.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za


More information about the Zope mailing list