[Zope] how to make an Product executable
Andy Dawkins
andyd@nipltd.com
Tue, 18 Jul 2000 12:37:15 +0100
> I have a question ..
> I create a product and i would like to to use my product when I select
> it from the objects combo box. But It always puts me into the security
> screen !!! and not my index_html. I have several methods in that product
..
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.
Hope that helps
-AndyD