Mercurial > hg > Feedworm
diff 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 |
line wrap: on
line diff
--- a/backend/couchdb/CouchDbBackend.py Sat Sep 10 04:43:40 2011 +0200 +++ b/backend/couchdb/CouchDbBackend.py Sat Sep 10 09:05:14 2011 +0200 @@ -55,7 +55,10 @@ # TODO how to hide read entries if requested? viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(), key=self.selectedFeed.id) - return list(viewResults) + viewResults = list(viewResults) + # TODO update date is a string ... convert to a ListDateTimeField for better sort support + viewResults.sort(FeedEntry.compareByUpdateDate, reverse=True) + return viewResults def markSelectedFeedAsRead(self): for feedEntry in self.entriesForSelectedFeed():