[Zope] Help w/ Date Sorting

JBeard@porternovelli.com JBeard@porternovelli.com
Wed, 5 Feb 2003 10:24:04 -0500


My Code:
<span tal:repeat="item python: sequence.sort(container.news.objectValues
('DTML Document'), (('dateline','cmp','desc'),) )">

What this is doing:
Using repeat to create a sequence of "DTML Docs" from my "news" folder.
Then it's running a sort of those documents using the "dateline" field and
sorting the objects from newest to oldest using cmp function.

What my dateline field is:
A property: type = string. They look like this "01-25-2003" and so on....

The error:
It's returning output similiar to this:
01-13-2003
01-14-2003
01-24-2003
01-31-2002
01-31-2003
02-14-2002
02-26-2002
This is definitely not what I'm after > I'm after the newest date first and
then on down.
And I can't use the bobobase date b/c some documents get updated at
different times (i.e a doc from 2002 could get updated today, but I don't
want that to be on top).

Any ideas?