[ZPT] sorting

alex alex@quad.com.ar
Wed, 23 Jan 2002 11:59:26 -0300


hey guys, I'm trying to perform batching (got that part already!) and
sorting (no clue yet) using zpt

I usually do the following:
myList=context.objectValues()
myList.sort(lambda a,b: cmp(a.getId(), b.getId()))
b=Batch(myList, size, start, orphan=0)

but I was wondering if Page Templates, ZTUtils or whatever brings a better
or easier way to perform sorting.
you know.. something as <dtml-in myList sort=someKey mapping> which is
pretty straight forward than using lambda's or custom compare functions for
sorting tuples, dicts, etc

I've been searching the list archive and didn't found much about it. The
zpt_examples.zexp have compilation errors and other kind of errors on some
of its examples, and I couldn't find anything about sorting at the source
code of ZTUtils... so, here I am waiting for some usefull feedback :)

Alex