if you're submitting from a form, you can coerce strings into other data
types by giving the form items special names, e.g.:

<input type=text name=foo:int>
<input type=text name=bar:float>

Your REQUEST then has variables called foo and bar which are ints and
floats, respectively.

also, don't post html mail - not everyone can read it.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Manuel Amador
Sent: 12 October 2000 09:12
Subject: [Zope] int and string comparisons

This is the snippet
   <dtml-in "_.range(1,32,1)">
        <option value="&dtml-sequence-item;"
        <dtml-let item=sequence-item>
        <dtml-if begin_day>
        <dtml-if expr="item == REQUEST.begin_day"> selected </dtml-if>
<dtml-comment>CONVERTIR A INT</dtml-comment>
The comparison fails because item is an int and REQUEST.begin_day is a
string (i guess).  How can I coerce item into a string, or REQUEST.begin_day
into an int?
 I tried python's builtin int() function around REQUEST.begin_day.  Won't
Any suggestions?
Manuel Amador (Rudd-O)

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to