Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

dtml-except

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


larrymcdonnell at att

Oct 4, 2010, 12:57 PM

Post #1 of 2 (621 views)
Permalink
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

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

Thanks in advance,

Larry McDonnell

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


lukesh at seznam

Oct 4, 2010, 10:40 PM

Post #2 of 2 (600 views)
Permalink
Re: dtml-except [In reply to]

----- Puvodní zpráva -----
Od: <larrymcdonnell [at] att>
Komu: <zope [at] zope>
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>


_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.