[Zope] int and string comparisons

Manuel Amador (Rudd-O) amador@alomega.com
Thu, 12 Oct 2000 03:12:06 -0500


--------------F181E4C9DE8090EF2366B5AC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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>
        </dtml-if>
        </dtml-let>
        >&dtml-sequence-item;</option>
      </dtml-in>

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 work.

Any suggestions?

--
Manuel Amador (Rudd-O)



--------------F181E4C9DE8090EF2366B5AC
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

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

--------------F181E4C9DE8090EF2366B5AC--