Sorry, write: obj=context.MyProduct.createInObjectManager(id, {}) On Thursday 05 September 2002 16:59, Borislav wrote:
Gouzy Nicolas wrote:
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='myBeautifulObj ect')
Zope has a problem with the first line: obj=context.MyProduct.createInObjectManager(id=id, {})
When I try to save the code I'm getting an error:
Zope has encountered an error while publishing this resource. Error Type: SyntaxError Error Value: non-keyword arg after keyword arg
When I comment out the first line, Zope accepts the code. Any suggestions?
--Borislav
-- Nicolas Gouzy Chef de Projet / Ingénieur de Développement OPIXIDO 9, cité paradis 75010 Paris tel : 01 40 22 92 46 ou 47 fax : 01 40 22 92 44