comparison backend/couchdb/CouchDbBackend.py @ 189:e5d492595bdb

the view returns feed entries for a feed sorted by update date now, no need to do sorting in-memory
author dirk
date Wed, 14 Sep 2011 00:17:55 +0200
parents ac1de0a467fd
children 7157bfd3f4d4
comparison
equal deleted inserted replaced
188:e26210be221f 189:e5d492595bdb
51 feedsWithUnreadEntries.append(feed) 51 feedsWithUnreadEntries.append(feed)
52 return feedsWithUnreadEntries 52 return feedsWithUnreadEntries
53 53
54 def _retrieveEntriesForSelectedFeed(self, hideReadEntries): 54 def _retrieveEntriesForSelectedFeed(self, hideReadEntries):
55 viewResults = FeedEntry.entriesForFeed(self.selectedFeed, self.database) 55 viewResults = FeedEntry.entriesForFeed(self.selectedFeed, self.database)
56 # TODO update date is a string ... convert to a ListDateTimeField for better sort support
57 viewResults.sort(FeedEntry.compareByUpdateDate, reverse=True)
58 if hideReadEntries: 56 if hideReadEntries:
59 filterFunc = lambda feedEntry: feedEntry.read == False 57 filterFunc = lambda feedEntry: feedEntry.read == False
60 viewResults = filter(filterFunc, viewResults) 58 viewResults = filter(filterFunc, viewResults)
61 return viewResults 59 return viewResults
62 60