[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Creating Basic Zope Applications
nobody@nowhere.com
nobody@nowhere.com
Tue, 20 Aug 2002 09:34:31 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/SimpleExamples.stx#3-57
---------------
Finally let's add the ability to sort this list by file name or by
modification date. Change the *index_html* method again::
<dtml-var standard_html_header>
<h1>File Library</h1>
<table>
<tr>
<th><a href="&dtml-URL0;?sort=name">File</a></th>
<th><a href="&dtml-URL0;?sort=date">Last Modified</a></th>
</tr>
<dtml-if expr="_.has_key('sort') and sort=='date'">
<dtml-in expr="objectValues('File')"
sort="bobobase_modification_time" reverse>
<tr>
<td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td>
<td><dtml-var bobobase_modification_time fmt="aCommon"><td>
</tr>
</dtml-in>
<dtml-else>
<dtml-in expr="objectValues('File')" sort="id">
<tr>
<td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td>
<td><dtml-var bobobase_modification_time fmt="aCommon"><td>
</tr>
</dtml-in>
</dtml-if>
</table>
<dtml-var standard_html_footer>
% Anonymous User - Aug. 20, 2002 9:34 am:
Could somebody explain to me what that _.has_key()-function does so that I might be able to reuse it in
another application?