Hi, I would like create a custom DTML-Method to edit a python-script within Zope. The reason for this is that I would like to be able to control in certain ways so I don't want to use "ZPythonScriptHTML_editForm". The user must not be able to change the whole script but only parts I let him see. Something like the 'manage_edit' object of DTML-Methods is (more or less) what I need. The result would be a web-form that lets the user edit some parts of the script body, the parameter and some aditional python code is added by a script/method. (I hope this makes sense ...) I am trying understand how the "PythonScript.py" does things but do to my limited knowledge (Zope-Newbie) I get stuck. My idea was to use the read() function to read the body into my custom form an write it back with the write() function. But doing this I don't use the nifty code-checking feature which I would like to use. Could someone please give me a hint if I am totally off-track? Regards Christoph
On Thu, 2003-09-11 at 12:19, Christoph Landwehr wrote:
Hi,
I would like create a custom DTML-Method to edit a python-script within Zope.
The best thing I can recommend is that you create a new product that subclasses the built-in python script. Then just make whatever changes to its interface you want. This won't be simple, but it'll be a heck of a lot better than trying to kludge together your desired functionality in the ZMI and will be a great learning experience besides. :-) HTH, Dylan
I would like create a custom DTML-Method to edit a python-script within Zope. The reason for this is that I would like to be able to control in certain ways so I don't want to use "ZPythonScriptHTML_editForm". The user must not be able to change the whole script but only parts I let him see. Something like the 'manage_edit' object of DTML-Methods is (more or less) what I need. The result would be a web-form that lets the user edit some parts of the script body, the parameter and some aditional python code is added by a script/method. (I hope this makes sense ...)
I am trying understand how the "PythonScript.py" does things but do to my limited knowledge (Zope-Newbie) I get stuck.
My idea was to use the read() function to read the body into my custom form an write it back with the write() function. But doing this I don't use the nifty code-checking feature which I would like to use.
You don't have to submit a form directly to the Python Script method that changes things. Submit it to your own method, check, change, and correct as you will, and send this to the method that actually makes the change on the object. I'm not sure about the read/write API you mention, since I haven't looked it up, but whatever the actual ZMI form submits to you can probably safely call too. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (3)
-
Christoph Landwehr -
Dylan Reinhardt -
J Cameron Cooper