15 Feb
2001
15 Feb
'01
10:26 p.m.
Olaf Zanger writes:
to do error tracking i want an
<dtml-elif "error_type == 'pg.error'">
<dtml-elif "find(error_value,'referential integrity violation')">
the first doesn't work since zope doesn't like the . ?? Zope will not see the '.'. It is inside a Python string.
the last because i don't find the an example how to use find right. "find" returns the index, the string is found at; "-1" if the string is not found.
Thus, you want something like "find(...) >= 0". Be careful, however! It is not garanteed that "error_value" will be a string (in general). It might well be an instance, then "find" will raise a "TypeError". Dieter
9181
Age (days ago)
9181
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dieter Maurer