[EMAIL PROTECTED] wrote:
I'm trying to use the 'sort-on' parameter in a Catalog search, and it
doesn't work. I use Zope 2.2.2.
I read in pasts messages that the 'sort-on' feature was broken, is it still?
The parameter to the Catalog's 'searchResults' method is spelled
'sort_on' (it must be a legal Python identifier, because it is
passed only as a keyword parameter). 'sort_on' is an attribute of
the 'dtml-in' tag; if you let the catalog sort for you, you will
be *much* better off (assuming it has a reasonable index to use,
that is).
Sorting won't work as expected with TextIndexes (but then, what is
"expected" in that case?)
I'm not sure if I use the right syntax so could someone post an sample code
here please ?
Here is a working snippet from the PTK::
dtml-let newsitems="portal_catalog.searchResults( meta_type='News
Item'
, sort_on='Date'
,
sort_order='reverse'
,
review_state='published' )"
dtml-in newsitems
...
/dtml-in
Tres
--
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers" http://www.zope.org
___
Zope maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )