faqts : Computers : Internet : Web Servers : Zope : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 12 people (75%) answered Yes
Recently 6 of 9 people (67%) answered Yes

Entry

Example: To create a new object you must supply an addForm and a method to add the product.

Jul 18th, 2000 06:19
unknown unknown, Andy Dawkins


To create a new object you must supply an addForm and a method to add 
the product.
e.g.
manage_addMyProductForm = HTMLFile('MyProductAdd',globals())
def manage_addMyProduct(self, id, title='')
        """Adds the product"""
        self.setObject(id, MyProduct(id,title))
        if REQUEST is not None:
                return self.manage_main(self, REQUEST)
The product tabs are defined in the manage_options section of the 
product.py The order is important the first item in the list is called 
when you access the object from the management screens.  The index_html 
is the default when accessed without the management screens.
For example:
    manage_options = ( # the management options available
        {'label': 'Contents',   'action': 'manage_main'},
        {'label': 'View',       'action': ''}, # defaults to index_html
        {'label': 'Properties',       'action': 
'manage_propertiesForm'},
        {'label': 'Security',   'action': 'manage_access'},
        )
Download the boring product from zope.org
It is a plain shell of an object that does nothing, but works.