[Zope-DB] Newbie - Z Search Interface, ZPT and nulls problem

Dieter Maurer dieter@handshake.de
Fri, 8 Nov 2002 23:27:54 +0100


Jakub Wisniowski writes:
 > ...
 >   <div tal:repeat="result batch">
 >   
 >          <tr>
 >           <td>
 >              <span tal:replace="result/Symbol">Symbol goes here</span>
 >           </td>
 >           ...
 > 
 >   When 'result/Symbol' is 'null' then I have no value in <td></td> tags.
 >   It's ok,
It is how it should by.

Try:

	      <span tal:replace="python: result.Symbol or 'null'">...</span>

or (better)
	      <span 
	        tal:define="sy	result/Symbol | nothing"
		tal:replace="sy is None and 'null' or sy">
		...
              </span>


Dieter