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
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 `------------------>
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 )
On Tue, 14 Aug 2001, Andreas Jung wrote:
You can also use the _.sequence.sort() method to customize the sorting. The function also allows to specify a user-defined function.
But you cannot do it in ZMI. Or you have to patch Zope... all ZMI DTMLs. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Be careful. The last time this got brought up, it nearly became a religious debate... 8^)
It did and I did a very simple patch on for it that worked a while ago, there are probably better ways now. It became a huge thread and it became overly complex. The simple fact is most of my users are not technical and simply want things easy to find. There I shall say no more. -- Andy McKay
Peter Bengtsson writes:
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 like it the way it is now....
If you don't: Oleg has developed a nice sorting extension. It has been incorporated in the "in" tag and also be provided as a function. In Zope 2.4, it is available in "_.sequence". Not only, it allows you to call for case insensitive sorting, it also support locale-aware sorting and arbitrary user defined sorting. Use it to create a customized version of the ObjectManager's content listing. If you add a configurable parameter to control sorting, then this might give a good feature request with patch for Zope's Collector. I know many users would like case insensitive searching, but some, like me, perfer the current solution. Dieter
participants (6)
-
Andreas Jung -
Andy McKay -
Casey Duncan -
Dieter Maurer -
Oleg Broytmann -
Peter Bengtsson