[Zope] Finding Newest Document

Andy McKay andym@ActiveState.com
Mon, 23 Jul 2001 08:06:10 -0700


Or the even faster (since it doesnt have to reverse anything):

article = Catalog(sort_on='dateofpublication')[-1]

Cheers.
--
  Andy McKay.


----- Original Message ----- 
From: "Chris Withers" <chrisw@nipltd.com>
To: "Dieter Maurer" <dieter@handshake.de>
Cc: <zope@zope.org>
Sent: Sunday, July 22, 2001 1:54 PM
Subject: Re: [Zope] Finding Newest Document


> Dieter Maurer wrote:
> > 
> >  > article = Catalog(sort_on='dateofpublication')[0]
> > Won't that give you the oldest document?
> 
> Yup :-)
> 
> I meant:
> article = Catalog(sort_on='dateofpublication',sort_order='reverse')[0]
> 
> *sheepish grinz*
> 
> Chris
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )
>