comparison backend/couchdb/CouchDbBackend.py @ 181:1ab48428e2f9

sort the feed entries
author dirk
date Sat, 10 Sep 2011 09:05:14 +0200
parents a4832a180c69
children 964661153b97
comparison
equal deleted inserted replaced
180:a4832a180c69 181:1ab48428e2f9
53 53
54 def _retrieveEntriesForSelectedFeed(self, hideReadEntries): 54 def _retrieveEntriesForSelectedFeed(self, hideReadEntries):
55 # TODO how to hide read entries if requested? 55 # TODO how to hide read entries if requested?
56 viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(), 56 viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(),
57 key=self.selectedFeed.id) 57 key=self.selectedFeed.id)
58 return list(viewResults) 58 viewResults = list(viewResults)
59 # TODO update date is a string ... convert to a ListDateTimeField for better sort support
60 viewResults.sort(FeedEntry.compareByUpdateDate, reverse=True)
61 return viewResults
59 62
60 def markSelectedFeedAsRead(self): 63 def markSelectedFeedAsRead(self):
61 for feedEntry in self.entriesForSelectedFeed(): 64 for feedEntry in self.entriesForSelectedFeed():
62 feedEntry.markRead(self.database) 65 feedEntry.markRead(self.database)
63 66