""" returns a sorted list of blogs and stories """ # 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 sortableEntries=[] entries=[] for entry in LazyFilter(context.objectValues(('News Item','OODocument')),skip=''): category=entry.Type() if (category=='Blog' or category=='Story') \ and entry.isEntryAllowedByFilter(subjectStr): sortableEntries.append((entry.rank,entry.id,entry)) if sortableEntries: sortableEntries.sort() for entryTuple in sortableEntries: entries.append(entryTuple[2]) return entries