[Zope] Newbie Question: Zope crashing

Dieter Maurer dieter@handshake.de
Wed, 8 Jan 2003 21:25:34 +0100


Ashley Lloyd wrote at 2003-1-7 14:57 +0000:
 > ....
 > I now have a Python script called convertDate, which takes one parameter, 
 > aDate:
 > ############################################################
 > try:
 >   thedate = DateTime(aDate)
 >   return thedate.strftime('%d/%m/%Y')
 > except:
 >   print "Error on date ", aDate
 >   return printed
 > ############################################################
 > ...
 > Finally, I have a DTML method called list_dates which again is simple:
 > ############################################################
 > <dtml-var standard_html_header>
 > 
 > <table border=1 width="60%" cellspacing=1>
 >     <tr><th>Date</th><th>Converted</th></tr>
 >   <dtml-in all_dates>
 >     <tr>
 >       <td width="50%"><dtml-var C_DATE></td>
 >       <td width="50%"><dtml-var "convertDate(C_DATE)"></td>
 >     </tr>
 >   </dtml-in>
 > </table>
 > 
 > <dtml-var standard_html_footer>
 > ############################################################
 > ....
 > If I try the DTML method as above, though, Zope stops responding completely. 
Strange. It should not do that.

I expect that "C_DATE" is already a "DateTime" instance.
Try

	"C_DATE.strftime('%d/%m/%Y')" instead of "convertDate(C_DATE)"


Dieter