[Zope] Attribute Error on Product Initialization

Dieter Maurer dieter@handshake.de
Thu, 23 Aug 2001 21:59:23 +0200 (CEST)


Several problems. Comments inserted into your post...

Ronald L. Chichester writes:
 > a product that I'm trying to get going, but I keep getting this nagging 
 > AttributeError on line 8 of my __init__.py file regarding them 
 > manage_addDoctrineAction.  For the life of me, I don't see what the problem 
 > could be.  Any hints anyone?
 > 
 > Here is the __init__.py file...
 > 
 > import Doctrine
 > 
 > def initialize(context):
 >         """Initialize the Legal Doctrine Product."""
 > 	
 >         context.registerClass(
 >                 Doctrine,
This should be a class, not a module...
You want:

		   Doctrine.Doctrine
 >                 constructors = (
 >                         Doctrine.manage_addDoctrineForm,
 >                         Doctrine.manage_addDoctrineAction
Your "manage_addDoctrineAction" is a class method not a module
function. Therefore, it is not in the module's namespace ("Doctrine").
The "AttributeError" is justified.

It should become a module function, as it is used to create
the object. It cannot be a method, as this would require
the object is already there.
 >                 ),
 > 		icon = 'images/Doctrine.jpg'
 >         )


Dieter