1 Apr
2001
1 Apr
'01
10:56 p.m.
container.manage_addProduct['PythonScripts'].manage_addPythonScript(idname)
To be fair, that's a pretty standard way of creating an instance of a product in Zope. If you've done any ZClasses programming, it should be familiar...
Ok So far so good. Since I am setting a named default,
Simplest solution might be to not provide a default ;-)
<dtml-if expr="mypyscript"> That object already exists. Choose another name. <dtml-else> ... manage_addPythonScript.. code goes here </dtml-if>
Please how do I do this basic task in Python Script?
if hasattr(context,idname): # That object already exists. Choose another name. else: context.manage_addProduct['PythonScripts'].manage_addPythonScript(idname) cheers, Chris