[Zope] Finding Newest Document

Chris Withers chrisw@nipltd.com
Tue, 24 Jul 2001 09:36:23 +0100


Andy McKay wrote:
> 
> Or the even faster (since it doesnt have to reverse anything):
> 
> article = Catalog(sort_on='dateofpublication')[-1]

True... what I actually did was keep track of the latest dateofpublication in a
property somewhere, and then do the following search when I want the latest
bits:

catalog = context.Catalog
properties_get = context.Properties.getProperty

return
catalog.searchResults(dateofpublication=properties_get('dateofpublication'))

cheers,

Chris