[Zope] Zieve.... one way to sort ZClasses dynamically...
Steve Spicklemire
steve@spvi.com
Tue, 3 Aug 1999 23:46:37 -0500 (EST)
Get it at: http://www.zope.org/Download/Contrib/Zieve.tgz
from the README:
Zieve 0-0-1
Zieve is a (beta) Z-subclassable class that assists in sorting
ZClasses in various ways. To use Zieve... unpack the tgz file in the
zope home folder. Then start Zope and create a ZClass with Zieve as a
base class. Then put an instance of this ZClass where you can reach it
from your folders of other ZClasses. Here is some DTML from a
DTMLMethod that uses a zclass derived from Zieve to do some sorting...
This displays a table heading with links that dynamically resort the
table according to which link was clicked last. The secondary,
tertiary, ...etc keys are remembered from prior clicks....
----------------------------------------------------------------------
<!--#var standard_html_header-->
<h2><!--#var title_or_id--></h2>
<br>
<!--
'theZieve' is an instance of a ZClass that is subclassed from Zieve.
'name', 'color', 'birthsone', 'number' are all properties of the ZClass.
The format 'name:format' allows you to specify a type or filter to
use before comparison.
-->
<!--#in "theZieve.sortObjects(
objectValues(['mySortableClass']),
REQUEST, RESPONSE,
defaultKeys=['name','color','birthstone','number:int'])"-->
<!--#if sequence-start-->
<center><table>
<tr>
<td><a href="theZieve/setSortPrimary?key=name">name</a></td>
<td><a href="theZieve/setSortPrimary?key=color">color</a></td>
<td><a href="theZieve/setSortPrimary?key=birthstone">birthstone</a></td>
<td><a href="theZieve/setSortPrimary?key=number:int">number</a></td>
</tr>
<!--#/if-->
<!--#with sequence-item-->
<tr>
<td><!--#var name--></td>
<td><!--#var color--></td>
<td><!--#var birthstone--></td>
<td><!--#var number--></td>
</tr>
<!--#/with-->
<!--#if sequence-end-->
</table></center>
<!--#/if-->
<!--#else-->
Sorry.. there are no objects to sort..
<!--#/in-->
<!--#var standard_html_footer-->
----------------------------------------------------------------------
steve@spvi.com