Easiest way to store the results of a form.
What is, in your opinion, the easiest way to store the results of a form, either from DTML or from a Python script? I'd rather not install a database, I can't write to disk files from python scripts... Any easy ways are appriciated, I have already thrown away several hours to do this and I completely refuse to waste any more time on this. There has to be a dead easy way that I have missed.
On Tuesday 12 February 2002 08:06 am, Lennart Regebro allegedly wrote:
What is, in your opinion, the easiest way to store the results of a form, either from DTML or from a Python script? I'd rather not install a database, I can't write to disk files from python scripts...
Any easy ways are appriciated, I have already thrown away several hours to do this and I completely refuse to waste any more time on this. There has to be a dead easy way that I have missed.
Create a ZClass with a property sheet that matches the values you want to store. Then modify the add form and the constructor to accept and store the values. /---------------------------------------------------\ Casey Duncan, Sr. Web Developer National Legal Aid and Defender Association c.duncan@nlada.org \---------------------------------------------------/
If your zope admin will grant you access to the zLOG module, you can simply do something like the following within a python script: from zLOG import LOG, INFO LOG('form_data', INFO, '%s' % context.request.form) This will log an entry into Zope's stupid logger file on the file system. - j At Tue, 12 Feb 2002 14:06:13 +0100, Lennart Regebro wrote:
What is, in your opinion, the easiest way to store the results of a form, either from DTML or from a Python script? I'd rather not install a database, I can't write to disk files from python scripts...
Any easy ways are appriciated, I have already thrown away several hours to do this and I completely refuse to waste any more time on this. There has to be a dead easy way that I have missed.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Lennart Regebro]
What is, in your opinion, the easiest way to store the results of a form, either from DTML or from a Python script? I'd rather not install a database, I can't write to disk files from python scripts...
Any easy ways are appriciated, I have already thrown away several hours to do this and I completely refuse to waste any more time on this. There has to be a dead easy way that I have missed.
I like to use an external method. You can store the entire form data in a single line in a file. In fact, you can use a hidden field in a form to declare what filename to use, so you can have the external method decide what filename to use for which form. It doesn't take much python code to accomplish this. Later you can process the file to get the data into a database, if you ever decide to do that. Cheers, Tom P
participants (4)
-
Casey Duncan -
Joseph Wayne Norton -
Lennart Regebro -
Thomas B. Passin