Can't currently be done at query time. However, you could populate a sort index with a combo of the values you want to sort on, such as this python script code: return context.lastname + context.firstname Put this in a Python script named LastFirst and add a matching field index and reindex it. Now use that as your sort index and you'll sort on multiple values. If the values aren't addable, then you can also just index a tuple of arbitrary length like: return (context.attr1, context.attr2, context.attr3) I have recently been working on the ZCatalog sorting code and it is possible to add this capability for Zope 2.7. How do people feel about this? Would many of you use it? I suppose one use would be grouping on reports. Zope 2.7 will contain many different sorting algorithms, it is likely that sorting on multiple keys will limit you to just a few possible algorithms. So the above technique would still be useful for best performance, however it is much less flexible. -Casey On Wednesday 11 December 2002 09:04 am, Giuseppe Bonelli wrote:
Hi all,
this appears to be an old question, but I have not found any reply on the mailing list archives.
Is there any trick to sort the results from ZCatalog on two or more indexes ?
TIA,
--peppo