[Zope] meaning error message
Jonothan Farr
jfarr@real.com
Wed, 15 Mar 2000 12:04:12 -0800
> My postgres database tables are setup to have unique index therefore no
> duplicates are not allow. If duplicate occur the db will return an
> error. Problem is when i try to submit duplicate data to the db i get
> an ugly error message. Is there anyway i can output my own error
> message for example "this data exist on the db already, please do not
> submit again" ? I don't want that error message because user's won't
> understand what is talking about.
I would solve this in the submit action by doing a select for the data before
doing an insert.
Example:
(form_html)
<form action="submit_html" method=post>
....
</form>
(submit_html)
<dtml-in select_data>
<dtml-if sequence-start>
<dtml-var error_message>
</dtml-if>
<dtml-else>
<dtml-call insert_data>
</dtml-in>
-jfarr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi! I'm a signature virus.
Copy me into your .sig to join the fun!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~