I am getting a vanilla sql.error message from Zope when testing a ZSQL method The ZSQL method is a single insert statement without any dtml-try/except wrapper. How do I get Zope to be a little more verbose about waht the problem is ? Nitin
On 12/9/99 3:15 PM, Nitin Borwankar at nitin@borwankar.com wrote:
I am getting a vanilla sql.error message from Zope when testing a ZSQL method The ZSQL method is a single insert statement without any dtml-try/except wrapper. How do I get Zope to be a little more verbose about waht the problem is
What DA are you using, this is up to the DA to throw genearlly. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com
Christopher Petrilli wrote:
On 12/9/99 3:15 PM, Nitin Borwankar at nitin@borwankar.com wrote:
I am getting a vanilla sql.error message from Zope when testing a ZSQL method The ZSQL method is a single insert statement without any dtml-try/except wrapper. How do I get Zope to be a little more verbose about waht the problem is
What DA are you using, this is up to the DA to throw genearlly.
Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com
I am using The ODBC DA with SQL Server 7.0. I appear to have solved the original problem so the lack of detail in sql.error is no longer an immediate obstacle. But I have hit the next one and it's very fundamental. How to link a data input form to a ZSQL method. I have a survey form that takes data and needs to insert into a database table with columns in 1-1 corr to the form field names. I have a ZSQL method (insert_survey_rec) that does "insert into survey1 ( <dtml-sqlvar e-mail type=string>,...)" The ZSQL method works as tested through it's Zope generated test form. Now I need to accept form input from my survey form ( survey_form ) and give a success/failure messge. When I use the action=insert_survey_rec in the form tag in survey_form, on submit I see a) no data inserted b) Zope returns to me the Zope generated test form for the ZSQL method. Clearly I need something in between the form and the ZSQL method that I am missing. What exactly is it ? Thanks for any help. Nitin
Nitin Borwankar wrote:
Christopher Petrilli wrote:
On 12/9/99 3:15 PM, Nitin Borwankar at nitin@borwankar.com wrote:
I am getting a vanilla sql.error message from Zope when testing a ZSQL method The ZSQL method is a single insert statement without any dtml-try/except wrapper. How do I get Zope to be a little more verbose about waht the problem is
What DA are you using, this is up to the DA to throw genearlly.
Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com
I am using The ODBC DA with SQL Server 7.0. I appear to have solved the original problem so the lack of detail in sql.error is no longer an immediate obstacle. But I have hit the next one and it's very fundamental. How to link a data input form to a ZSQL method.
I have a survey form that takes data and needs to insert into a database table with columns in 1-1 corr to the form field names.
I have a ZSQL method (insert_survey_rec) that does "insert into survey1 ( <dtml-sqlvar e-mail type=string>,...)" The ZSQL method works as tested through it's Zope generated test form.
Now I need to accept form input from my survey form ( survey_form ) and give a success/failure messge.
When I use the action=insert_survey_rec in the form tag in survey_form, on submit I see a) no data inserted b) Zope returns to me the Zope generated test form for the ZSQL method.
Clearly I need something in between the form and the ZSQL method that I am missing. What exactly is it ?
You miss another dtml page that does <dtml-call insert_survey_rec> and also has other things you may want to give back as the visible result of submitting the page
Thanks for any help.
Nitin
_______________________________________________ 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 )
Hannu Krosing wrote:
You miss another dtml page that does <dtml-call insert_survey_rec> and also has other things you may want to give back as the visible result of submitting the page
So would it have simply the following ( syntax ? ) <dtml-with REQUEST> <dtml-try> <dtml-call "insert_survey_rec(e-mail,...)" > <- syntax ? quotes around e-mail? Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ... </dtml-try> </dtml-with> Thanks again.
Thanks for any help.
Nitin
_______________________________________________ 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 )
_______________________________________________ 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 )
All but the call line which should look like: <dtml-call insert_survey_rec> Don't think you need the with either for that matter..... Josh At 1:54 PM -0800 12/9/99, Nitin Borwankar wrote:
Hannu Krosing wrote:
You miss another dtml page that does <dtml-call insert_survey_rec> and also has other things you may want to give back as the visible result of submitting the page
So would it have simply the following ( syntax ? )
<dtml-with REQUEST> <dtml-try>
<dtml-call "insert_survey_rec(e-mail,...)" > <- syntax ? quotes around e-mail? Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ...
</dtml-try> </dtml-with>
Thanks again.
# # # _____________________________________________ Joshua Brauer Box 915 http://www.brauer.org Fort Collins, CO 80522 Fax: (419) 793-4120 _____________________________________________ In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900 ____________________________________________________
OK, tried that - the message I get back from the try/except shows I succeeded and yet no data turns up in the database. It's not clear to me how form data is passed to insert_survey_rec in this syntax. I am really stuck within an inch of success - any help appreciated. Nitin. Joshua Brauer wrote:
All but the call line which should look like:
<dtml-call insert_survey_rec>
Don't think you need the with either for that matter.....
Josh
At 1:54 PM -0800 12/9/99, Nitin Borwankar wrote:
Hannu Krosing wrote:
You miss another dtml page that does <dtml-call insert_survey_rec> and also has other things you may want to give back as the visible result of submitting the page
So would it have simply the following ( syntax ? )
<dtml-with REQUEST> <dtml-try>
<dtml-call "insert_survey_rec(e-mail,...)" > <- syntax ? quotes around e-mail? Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ...
</dtml-try> </dtml-with>
Thanks again.
# # #
_____________________________________________ Joshua Brauer Box 915 http://www.brauer.org Fort Collins, CO 80522 Fax: (419) 793-4120 _____________________________________________ In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900 ____________________________________________________
_______________________________________________ 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 )
simpler even: <dtml-try> <dtml-call insert_survey_rec> Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ... </dtml-try>
-----Original Message----- So would it have simply the following ( syntax ? )
<dtml-with REQUEST> <dtml-try>
<dtml-call "insert_survey_rec(e-mail,...)" > <- syntax ? quotes around e-mail? Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ...
</dtml-try> </dtml-with>
Jens Vagelpohl wrote:
simpler even:
<dtml-try>
<dtml-call insert_survey_rec>
So are you saying here that I do not have to explicitly pass parameters to insert_survey_rec because they exist in the REQUEST and the names match ? Also - no " " around insert_survey_rec? Or are you just saying I could drop the <dtml-with REQUEST>. I am making progress slowly and my current problem is the exact syntax of parameters passed to insert_survey_rec. Any help appreciated. Nitin.
Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ...
</dtml-try>
-----Original Message----- So would it have simply the following ( syntax ? )
<dtml-with REQUEST> <dtml-try>
<dtml-call "insert_survey_rec(e-mail,...)" > <- syntax ? quotes around e-mail? Your survey was submitted successfully! Thanks! <dtml-except> There was a problem processing your survey. Please try again, or send e-mail to ...
</dtml-try> </dtml-with>
participants (5)
-
Christopher Petrilli -
Hannu Krosing -
Jens Vagelpohl -
Joshua Brauer -
Nitin Borwankar