[Zope] Re: problem using manage_addPageTemplate

Lee Harr missive at hotmail.com
Fri Jul 2 11:02:27 EDT 2004


>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

[...]

I think you need to be careful about trying to define __init__ in your
subclass.  The only products I have made only inherit from Folder,
but I never defined any __init__. The way I added sub-objects while
adding instances of my product was in a separate
manage_addMyCustomProduct() function ...


>I get this error :
>
>Site Error
>
>An error was encountered while publishing this resource.
>
>Error Type: AttributeError
>Error Value: _getProducts
>
>

It seems like your Product is not being initialized properly. Wouldn't
you need to call __init__ for Folder, Persistent, RoleManager, and Item
so they can run their initialization code?

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail



More information about the Zope mailing list