[Zope] SortEx module feature request thinking

Peter Bengtsson mail@peterbe.com
Tue, 28 Aug 2001 16:03:14 +0200


If you pass an argument to sort on to the SortEx and pass also 'nocase' it
breaks if the thing to sort on cannot be case insensitive.

This works:

r=SortEx(sequence, ( ( 'companyName' ,  ) , )  )
# and this
r=SortEx(sequence, ( ( 'companyName' , 'nocase' ) , )  )
# and this
r=SortEx(sequence, ( ( 'modificationTime' , ) , )  )
# But this breaks! of course
r=SortEx(sequence, ( ( 'modificationTime' , 'nocase' ) , )  )

Sensible.

But suppose that one really doesn't know what one is sorting one?
* If its a string property, I want it case-insensitive.
* If its a date property, don't pass the 'nocase' thing

Maybe there is a way to do this, but I don't know how. So how?
If there isn't a way to do this, can I suggest a syntax like this:

r=SortEx(sequence, ( ( REQUEST.foobar , 'nocase' , 'anyproperty' ) , )  )
...or...
r=SortEx(sequence, ( ( REQUEST.foobar , 'nocase_nocomplain' ) , )  )


Regards, Peter