<br><font size=2><tt>Hello all,</tt></font>
<br>
<br><font size=2><tt>I am a newbie at Zope, slowly traversing the learning
curve. I am focusing on TAL currently, and am quite a bit confused
with the tal:condition syntax. I have a Z SQL Method that selects
all records from a table in a PostgreSQL database. This method is
called "getTransfers". I then have a Page Template called
"displayTransfers" that displays the results as tabular HTML.</tt></font>
<br>
<br><font size=2><tt>This works fine. However, where there isn't
a record (i.e. an empty string), a <TD> will not be defined so that
it leaves ugly gaps in the table. To ensure that a '<TD>&nbsp;</TD>'
replaces an empty string '' I added two tal:condition statements. This
works, but is sort of ugly looking as, in my head, it is the equivalent
of two 'if' statements when it should be an 'if/else'. The below
code works, however is there a cleaner way to do this?</tt></font>
<br>
<br><font size=2><tt>### START CODE ###</tt></font>
<br>
<br><font size=2><tt><table border="1"></tt></font>
<br><font size=2><tt> <tr><th>Date</th><th>Server</th></tr></tt></font>
<br><font size=2><tt> <tr tal:repeat="transfer container/getTransfers"></tt></font>
<br><font size=2><tt> <td tal:content="structure transfer/time_stamp">time_stamp</td></tt></font>
<br><font size=2><tt> <td tal:condition="python: transfer.server==''">&nbsp;</td>
</tt></font>
<br><font size=2><tt> <td tal:condition="python: transfer.server!=''"</tt></font>
<br><font size=2><tt> tal:content="structure
transfer/server">server</td></tt></font>
<br><font size=2><tt> </tr></tt></font>
<br><font size=2><tt></table></tt></font>
<br>
<br><font size=2><tt>### END CODE ###</tt></font>
<br>
<br><font size=2><tt>I'm from a PHP/Perl/mySQL/postgreSQL background and
am new to OOP, Python and Zope so I greatly appreciate any assistance with
this.</tt></font>
<br>
<br><font size=2><tt>Regards,</tt></font>
<br><font size=2><tt>Tom</tt></font>