[Zope] Int to String

Jeff Peterson jpeterso@rangebroadband.com
Thu, 2 Aug 2001 15:51:52 -0500


A couple of options:

In dtml (yuck!)

<dtml-in expr="_[_.str(ZopeTime().year())].objectValues()">
<dtml-var id>
</dtml-in>

In a python script:

y = context.ZopeTime().year()
for item in context[str(y)].objectValues():
  print item.id()
return printed

Good luck!

--
Jeffrey D. Peterson
Webmaster/Web & Web Applications Engineer
Range TV Cable & Broadband
1818 E. 3rd Ave.  Hibbing, MN 55746
jpeterso@rangebroadband.com

(And Steve Drees too...)


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Alexandre Aguiar
> Sent: Thursday, August 02, 2001 1:41 PM
> To: zope@zope.org
> Subject: [Zope] Int to String
>
>
> Im working with folders wich the ids are the years (2000, 1999 and so on).
>
> Im trying to list a folder using the following code:
>
> <dtml-with ZopeTime>
>   <dtml-let ano="year()">
>         <dtml-in expr="ano.objectValues()">
>         <dtml-var id>
>         </dtml-in>
>    </dtml-let>
> </dtml-with>
>
> The year() function returns an Int, so when I call
> 'ano.objectValues()' zope
> does not understand it, because it is waiting a string.
>
> How can I turn my Int into a string? Or how can I make this easier?
>
> Thanks for the aid
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>