If I write DTML that way: <td><dtml-var telephone missing="(No phone)"></td> and if "telephone" comes from a ZSQL method, "missing" is ignored even if the field was NULL (in SQL sense). Is it normal? Zope version: Zope 2.2.2 (source release, python 1.5.2, linux2) Python version: 2.0c1 (#2, Nov 24 2000, 11:08:10) [C] System Platform: osf1V4 PostgreSQL 7.0.3 (with Z PyGreSQL, ZPyGreSQLDA-0-0-3)
If I write DTML that way:
<td><dtml-var telephone missing="(No phone)"></td>
and if "telephone" comes from a ZSQL method, "missing" is ignored even if the field was NULL (in SQL sense). Is it normal?
"missing" is only effective if the variable telephone cannot be found. Even if it has a null or None value, it's not considered missing. Try <dtml-var telephone null="(No phone)"> instead. _______________________ Ron Bickers Logic Etc, Inc. rbickers@logicetc.com
On Wednesday 17 January 2001, at 11 h 30, the keyboard of "Ron Bickers" <rbickers@logicetc.com> wrote:
"missing" is only effective if the variable telephone cannot be found. Even if it has a null or None value, it's not considered missing. Try <dtml-var telephone null="(No phone)"> instead.
This one works fine (you got the reason right) and I missed it in the documentation. Emmanuel Philippot <strasser@multimania.com> suggested another way, which seems to do the same: <dtml-var telephone><dml-unless telephone>(No phone)</dtml-unless> Thanks to both of you.
participants (2)
-
Ron Bickers -
Stephane Bortzmeyer