[Zope-DB] writing a template to test if the sql worked

Laura McCord Laura.McCord at doucet-austin.com
Tue May 4 11:31:33 EDT 2004


Hi,

 If I have an edit form and I click on edit after inserting the info
into the fields I am redirected to a dtml method that I am using to call
the zsql method and it tests if it was successful using the <dtml-try>
and <dtml-except> conditons. This is the code that I am using:

<html>
<body bgcolor="#e7e7e7">
<font color="#0a4f72" size="4"> 
<dtml-if name="create">
<dtml-try>
 <dtml-call name="add_pc_sql">
 The pc, <strong><dtml-var name="pcname">,</strong>
 was successfully added to the database.
 <dtml-except>
 Sorry, the pc was not added to the database.
 </dtml-try>
</dtml-if>
</font>
</body>
</html>

I have been looking in the zope book and trying to learn how I could
change this into a page template instead of a dtml method. Is there
anything in page templates that can do the error checking like this dtml
method? I wasn't sure if I would be using a <tal:condition> to achieve
this. 

Thanks.



More information about the Zope-DB mailing list