Your constructor "MyProduct_add" is a DTML Method, isn't it ? Delete it and replace by a Python Script called "MyProduct_add" ====================================== # MyProduct_add source # ====================================== Parameter List: id, REQUEST=None Code: obj=context.MyProduct.createInObjectManager(id=id, {}) if REQUEST is not None: try: u=context.DestinationURL() except: u=REQUEST['URL2'] REQUEST.RESPONSE.redirect(u+'/manage_workspace') ======================================================= Now, you can write in a Python Script: container.manage_addProduct['MyProduct'].MyProduct_add(id='myBeautifulObject') On Wednesday 04 September 2002 21:14, Borislav wrote:
Gouzy Nicolas wrote:
You can try:
container.manage_addProduct['MyProduct'].MyProduct_add()
MyProduct_add is the constructor of the ZClass MyProduct
How do I pass the object id to this constructor? Seems that it reads it from the REQUEST, but I can't assign to REQUEST in a python script. This code:
context.REQUEST['id'] = myObjectId container.manage_addProduct['MyProduct'].MyProduct_add()
produces an error:
Error Type: TypeError Error Value: object does not support item or slice assignment
Am I missing something?
--Borislav
-- Nicolas Gouzy Chef de Projet / Ingénieur de Développement OPIXIDO 9, cité paradis 75010 Paris FRANCE tel : 01 40 22 92 46 ou 47 fax : 01 40 22 92 44