[Zope] python product - newbie

Bak @ kedai bak@nstp.com.my
Thu, 22 Jun 2000 11:51:49 +0800


On Thu, 22 Jun 2000, Loren Stafford wrote:
> You don't show the __init__.py file so it's hard to be sure, but...
> 
> 

well, here's my __init__.py
--
 
__doc__ = """Boring initialization module.
My first product - Guest book
 
See README.txt for more details."""
 
# Version string. Usually updated automatically by CVS.
 
__version__ = '0.1' # Anything more and it'd be Interesting.
 
# Step #1: import your Python class so we can refer to it later
 
import GB
 
 
def initialize(context):
    """Initialize the Boring product.
    registerClass() can accept a lot more arguments than we're providing
    here, but that wouldn't be Boring."""
 
    try:
        """Try to register the product."""
 
        context.registerClass(
 
            GB.GB,                   # Which is the addable bit?
            constructors = (                 # The first of these is called
                GB.manage_addGBForm, # when someone adds the product;
                GB.manage_addGB),    # the second is named here so we
                                             # can give people permission to
                                             # call it.
 
            icon = 'item.gif'                # This icon was provided by the
                                             # Zope 1 product-in-Python demo.
            )
 
    except:                                                                  
 
        import sys, traceback, string
        type, val, tb = sys.exc_info()
        sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
        del type, val, tb          
---

i registered GB, with forms and it's equivalent manage action.  that's ok.  but
to nest another class in GB, and to have the 'Add GBitem' show on the manage
interface, that, i can't do.
what should be added,  and where?

i looked at the old product API, but got more confused because i think Boring
is based on another way of making product.  is that so?

thabks