[Zope] "James W. Howe" <jwh@allencreek.com>

Alexandre Ratti alex@gabuzomeu.net
Fri, 28 Jan 2000 18:42:27 +0100


Hi James,


If you sort by modification time in reverse order and set batchsize to 1 
then I think you'll get the latest instance.

Example:

   <dtml-in "Catalog.searchResults()" sort=bobobase_modification_time
    reverse size=1>
    ...
   </dtml-in>


I'm not sure it's the best way, though.


Alexandre


At 12:00 27/01/2000 -0800, you wrote:
>Date: Thu, 27 Jan 2000 14:55:33 -0500
>To: zope@zope.org
>From: "James W. Howe" <jwh@allencreek.com>
>Subject: [Zope] ZCatalog Search Question
>
>Is there a simple (or even a not so simple) way to ask a ZCatalog to return
>the most recent instance of a particular meta_type?  Suppose that I create
>several objects with a meta_type of 'Article'.  I would like to be able to
>retrieve the last one created whether it was today or 2 months ago.
>
>Thanks.
>
>James W. Howe                           mailto:jwh@allencreek.com
>Allen Creek Software, Inc.              pgpkey: 
>http://ic.net/~jwh/pgpkey.html
>Ann Arbor, MI  48103