[Zope-CMF] addProduct vs init. Need explanations

Dieter Maurer dieter@handshake.de
Tue, 5 Nov 2002 20:55:13 +0100


Pascal Samuzeau writes:
 > If I have a product's python source, I've something as:               
 >                                                                       
 > from ....                                                             
 >                                                                       
 > factory....                                                           
 >                                                                       
 > def addProductA(...)                                                  
 > ...                                                                   
 >                                                                       
 > class ProductA(..)                                                    
 >                                                                       
 > ...                                                                   
 >                                                                       
 >    def init(..)                                                       
 >      ....                                                             
 >                                                                       
 > InitializeClass(ProductA)                                             
 >                                                                       
 >                                                                       
 > Ok, But What addProductA for ?                                        
It is the function that creates your new "ProductA" objects and adds
them to a container.
Usually, it is the action use in the form that requests the necessary
parameters for object creation. This form in turn is usually
activated by the ZMI's "add list".

 > I mean if I add a ProductA under a CMFSite, only the init'class is    
 > calling.                                                              
Should I understand what you are saying here?

When you use your product as content class of a CMF Type, then
you would put the "addProductA" as "Product Factory" in the type
description.


Dieter