""" returns a sorted list of log entries """ # Copyright © 2004 Saugus.net, Inc. # All Rights Reserved. # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. from ZTUtils import LazyFilter #zcat=context.portal_catalog #sortableEntries=[] #for objCat in zcat(query='/Local/Guestbook',level=-1, # Subject='Guestbook'): # entry=objCat.getObject() # if entry.isEntryAllowedByFilter(subjectStr): # sortableEntries.append((entry.rank,entry.creation_date,entry)) sortableEntries=[] for entry in LazyFilter(context.objectValues('News Item'),skip='View'): if entry.Type()=='Log Entry' and entry.isEntryAllowedByFilter(subjectStr): sortableEntries.append((entry.rank,entry.creation_date,entry)) if len(sortableEntries)>0: sortableEntries.sort() sortableEntries.reverse() entries=[] for entryTuple in sortableEntries: entries.append(entryTuple[2]) return entries else: return None