[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> <dtml-in "_.range(1,32,1)">
<br> <option value="&dtml-sequence-item;"
<br> <dtml-let item=sequence-item>
<br> <dtml-if begin_day>
<br> <dtml-if expr="item ==
REQUEST.begin_day"> selected </dtml-if>
<br><dtml-comment>CONVERTIR A INT</dtml-comment>
<br> </dtml-if>
<br> </dtml-let>
<br> >&dtml-sequence-item;</option>
<br> </dtml-in>
<p>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?
<br> I tried python's builtin int() function around REQUEST.begin_day.
Won't work.
<p>Any suggestions?
<pre>--
Manuel Amador (Rudd-O)</pre>
</html>
--------------F181E4C9DE8090EF2366B5AC--