Re: [Zope] Newbie Question: Zope crashing
I have also attempted using a dtml-try..except around the <dtml var "convertDate(C_DATE)">, and even around the entire dtml-in, but this had no effect. Sorry, I forgot to put this in when I posted!! From: "Ashley Lloyd" <ashleylloyd@hotmail.com> To: zope@zope.org Subject: [Zope] Newbie Question: Zope crashing Date: Tue, 07 Jan 2003 14:57:54 +0000 I have posted in the last few days asking for help formatting a date retrieved from an Interbase db (thanks very much to Kevin Carlson for the help with that). 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 ############################################################ I also have an SQL method called all_dates which is simply: select C_DATE from CALENDAR order by C_DATE 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 dtml-comment out the "convertDate(C_DATE)" output line, the DTML method works fine. I have tried testing the SQL, which works fine. I have tried testing the script using an actual date from the database - retrieved by commenting out the line mentioned, and this returns the date fine. I have checked for rogue/empty C_DATE values in the database, there are none. I have also tested the script using a random text input, and the try..except gave the expected error message. I have tried replacing "convertDate(C_DATE)" with something like "convertDate('2000-01-01 00:00:00.00')" (date format retrieved again from the db in the manner outlined above), and this allows the page to be viewed fine. If I try the DTML method as above, though, Zope stops responding completely. The dataset is by no means large (max 30 entries), and I have allowed it 10 mins before giving up! I am using Zope version 2.5.1 (Python version 2.1.3) on Win 2k. Can anyone help? Kind regards Ashley _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail _______________________________________________ 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 ) _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
participants (1)
-
Ashley Lloyd