> Andy McKay wrote:
> > Minor nit and patch: I've found that really for me what users want to
see is
> > a case insensitive sort of objects, not the current python case
> > sort. So that the order of objects from dtml-in and tree is a, A, b, B
> > apposed to A, B, a, b.
> >
> > Anyway Ive patched dtml-in and dtml-tree to do this sort on a
> > tag. Is this useful to anyone else? And Ive thought of patching my Zope
> > this is the default behaviour.... what does anyone else think. The next
> > thing to patch is ZCatalog...
> The way I approached this was to have a ZPatterns attribute provider, or
> a method, that provides a modified version of the value I want to sort on.
> For example, I have a load of documents and folders with titles like
>   Big Folder
>   brown document
>   "Berries for Cooking" list
> I wanted to present these sorted by non-case-sensitive first letter or
> number. So, I made a method "title_for_sorting" that stripped off any
> punctuation at the start, and returned the first 20 characters in all
> lower case.  In this case, as it was a ZPatterns application, the method
> was presented as an attribute of the object using some skin-script. I
> used this attribute as a field-index in my SiteIndex ZCatalog.
> The reason I mention this is that sometimes case-insensitivity is not
> enough for sensible sorting. In this case, I had to strip out
> punctuation too.

Hm, reading this... just a loose comment.
In light of the awkward search interface of ZCatalogs, would it be a good
idea to make a search interface for ZCatalog ZPatterns based? This would add
the possibility to make it configurable wrt case sensitivity, and to do nice
things with ANDing and ORing different kinds of indexes.
The only thing I can't judge whether it would be possible to make this
generic enough.



Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to