Martijn, Thanks very much, that did the trick! Chris
The sort attribute only accepts a the name of the attribute on which to sort. It is not an expression, and therefore not dynamic. In your case, Zope will try and sort on the 'sortkey' attribute, which does not exist, hence the AttributeError.
However, ZCatalog does accept a 'sort-on' attribute. If that variable is present in the REQUEST object, or is passed to the searchResults method of the catalog, the resultset will be sorted on the index specified in that attribute. Note that you can only sort on attributes that are indexed, you cannot sort on any of the stored schema data.
Also note that this feature is partly broken in Zope 2.0, but is fixed for the next release of Zope. The fix is small: at line 411 of Catalog.py (lib/python/Products/ZCatalog), change sort_index.items() into sort_index._index.items().
-- 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 ------------------------------------------