[Zope] dtml-except

larrymcdonnell at att.net larrymcdonnell at att.net
Mon Oct 4 15:57:46 EDT 2010


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 

I have trapped for errors like this before using this method but no luck this time.

Thanks in advance,

Larry McDonnell



More information about the Zope mailing list