[Zope] Newbie Question: Zope crashing
Ashley Lloyd
ashleylloyd@hotmail.com
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