[Zope-dev] Catalog search cannot sort on a FieldIndex?

Martijn Pieters mj@antraciet.nl
Wed, 08 Sep 1999 15:39:45 +0200


Hello all, and especially Michel =)

Why is it I query the ZCatalog, and have the results sorted on a FieldIndex?

Something like:

  res=apply(cat.searchResults, (), {'sort-on': 'aFieldIndex'})

gives me a AttributeError: items on line 411 of Catalog.py.

Maybe I am trying something very stupid here. I have a bunch of objects 
catalogued with a FieldIndex on a DateTime property. If call searchResults 
without arguments, it all works beautifully, and the result objects sport 
my DateTime property. But I want to retrieve these objects sorted on the 
DateTime property.

Note that I want the results sorted by the Catalog, I am not using this in 
any DTML, so I cannot rely on the in tag's sort attribute. I also wanted to 
use the more efficient sort results of the Catalog, and the advantages of 
the LazyCat object..

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------