Specify the sorting direction for the various columns/

Mark Tolonen metolone+gmane at gmail.com
Fri Jun 12 06:55:16 CEST 2009

"Oni" <drentha at gmail.com> wrote in message 
news:018f4fa2-7203-4c98-a313-da5584976bd9 at z20g2000prh.googlegroups.com...
> Managed to get a dictionary to sort on multiple columns using a tuple
> to set the sort order (see below). However how can I control that
> column "date" orders descending and the column "name" orders
> ascending.

One way is to sort twice...sort on the secondary key first, then the primary 
key.  sort will maintain the order of equal entries.


More information about the Python-list mailing list