[Zope] Return success or fail from ZSQL method

Sion Morris s.morris@bangor.ac.uk
Fri, 8 Jun 2001 10:02:26 +0100


Hi,

I have a form which when submitted calls a python scripts. The python 
scripts in turn calls a ZSQLMethod which enters data into a MySQL 
data. When the python script has done the data entry, either 
succesfully or not I would like it to point to a DTML method which 
will report on the action to the user.

What is the best way to do this:

1. Form -> DTML Method x  -> ZSQL Method -> DTML Method x
How do I return a success or failure flag from the ZSQLMethod to DTML 
Method x? Does the ZSQL Method return anything once it has done it's 
operation?

2. Form -> PythonScript y -> ZSQL Method -> PythonScript y ->DTML Method x
This option is neater (Python v DTML) for the kind of SQL I'm doing 
but I don't know how to return a success or failure flag to the final 
DTML method to report to the user.

I don't want to send the form directly to the ZSQL because I need to 
perform some action on the form fields.

Any advice?

Thanks,

Sion

--