[Zope] dtml-in sorting on lists
ririe@spininternet.com
ririe@spininternet.com
Mon, 15 Apr 2002 18:10:38 -0400 (EDT)
Hi,
I would like to use dtml-in's sort functionality, but on indices
of lists, not attributes.
Basically, I have a function, say getLoL() that generates a list of
lists ( e.g. [ [A1,A2,A3],[B1,B2,B3], ...]
I can use dtml-in to loop through this like:
<dtml-in expr="getLoL()">
First index: <dtml-var expr="_.getitem('sequence-item')[0]">
</dtml-in>
How can I now sort based on say the second index of the sequence-item?
(ie sort A2, B2, C2, etc)
I've looked at the DT_In.py code, and think I need to make
modifications to allow for indexing (as opposed to getattr's)
but was wondering if there was an existing way.
Thanks,
Robert
------------------------------------------------------------
Get unlimited dialup access at http://www.spininternet.com/