[Zope] dtml-except
Jaroslav Lukesh
lukesh at seznam.cz
Tue Oct 5 01:40:27 EDT 2010
----- Puvodní zpráva -----
Od: <larrymcdonnell at att.net>
Komu: <zope at zope.org>
Odesláno: 4. ríjna 2010 21:57
Predmet: [Zope] dtml-except
> Hi,
>
> I need the old timers to help with a zope dtml-try/dtml-except conditions.
> I am using Zope 2.6.1. My problem is as follows:
>
> <dtml-if expr="fluency_temp<>''">
> fluency - <dtml-var fluency_temp>**
>
> <dtml-call "REQUEST.set('fluency_test', fluency_temp)">
>
> <dtml-call "string_to_int(fluency_test ,REQUEST)">
> <dtml-try>
>
> <dtml-call "REQUEST.set('fluency', y)">
>
> <dtml-except ValueError>
>
> <dtml-call "REQUEST.set('name_error', 'error')">
>
> <dtml-if expr="name_error=='error'">
>
> Invalid Number entered
> <a href="../prek_4_dra_scoring_system/display_student ">
> Click here to go back</a>
>
> <dtml-else>
>
> <dtml-call "REQUEST.set('student_full_name', student_full_name)">
> <dtml-call "REQUEST.set('dra', dra_temp)">
> <dtml-call "REQUEST.set('date_scored', ZopeTime())">
> <dtml-call "REQUEST.set('fluency', fluency)">
>
> <dtml-call expr="update_dra_edl_score_1_4_record_eng(REQUEST)">
>
> </dtml-if>
> </dtml-try>
>
> </dtml-if>
> </dtml-in>
> </dtml-if>
>
> I will see an error if I enter a letter and not a number -
>
> Exception Type ValueError
> Exception Value invalid literal for int(): a
>
fluency - <dtml-var fluency_temp missing="N/A" null="N/A">**
<dtml-try>
<dtml-call "REQUEST.set('fluency_test', _.int(fluency_temp))">
<dtml-call "REQUEST.set('fluency', y)">
<dtml-call "REQUEST.set('student_full_name', student_full_name)">
<dtml-call "REQUEST.set('dra', dra_temp)">
<dtml-call "REQUEST.set('date_scored', ZopeTime())">
<dtml-call "REQUEST.set('fluency', fluency)">
??? what you want to do with this ???
<dtml-call expr="update_dra_edl_score_1_4_record_eng(REQUEST)">
??? what you want to do with this ???
<dtml-except ValueError>
<dtml-call "REQUEST.set('name_error', 'error')">
Invalid Number entered
<a href="../prek_4_dra_scoring_system/display_student ">
Click here to go back</a>
</dtml-try>
More information about the Zope
mailing list