[Zope] ZCatalog Search Question

Martijn Pieters mj@digicool.com
Fri, 28 Jan 2000 17:17:41 -0500


> -----Original Message-----
> From: James W. Howe [mailto:jwh@allencreek.com]
> 
> 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.

Have the catalog sort on date, and take the first (or last) item of the
results list.

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------