[Zope] Sorting case-insensitivly

Andreas Jung Andreas Jung" <andreas@andreas-jung.com
Tue, 14 Aug 2001 14:05:57 -0400


You can also use the _.sequence.sort() method to customize
the sorting. The function also allows to specify a user-defined
function.

Andreas
----- Original Message -----
From: "Casey Duncan" <cduncan@kaivo.com>
To: "Peter Bengtsson" <mail@peterbe.com>
Cc: <zope@zope.org>
Sent: Dienstag, 14. August 2001 14:00
Subject: Re: [Zope] Sorting case-insensitivly


> Peter Bengtsson wrote:
> >
> > In the ZMI all the objects are by default sorted alphabetically starting
> > with Capital A and ending with small z.
> > What if you don't want it to be case sensitive? It's prett darn ugly the
way
> > it is at the moment.
> >
> > I do something like this:
> >
> > <dtml-in GetLotsOfObjects sort=id>
> >
> > And it returns
> >
> > Peter
> > Zope
> > bengtsson
> > rocky
> >
> > When I'd like it to be:
> >
> > bengtsson
> > Peter
> > rocky
> > Zope
> >
> > Cheers,
> > Peter
> >
>
> Be careful. The last time this got brought up, it nearly became a
> religious debate... 8^)
>
> There is a way to substitute a sorting expression in dtml-in which
> allows this. I think something like this might work:
>
> <dtml-in Lots_o_objects sort_expr="_.string.lower(id)">
>
> hth,
> --
> | Casey Duncan
> | Kaivo, Inc.
> | cduncan@kaivo.com
> `------------------>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )