diff backend/couchdb/CouchDbBackend.py @ 183:ac1de0a467fd

clean up
author dirk
date Sun, 11 Sep 2011 06:51:14 +0200
parents 964661153b97
children e5d492595bdb
line wrap: on
line diff
--- a/backend/couchdb/CouchDbBackend.py	Sat Sep 10 09:15:25 2011 +0200
+++ b/backend/couchdb/CouchDbBackend.py	Sun Sep 11 06:51:14 2011 +0200
@@ -52,13 +52,12 @@
         return feedsWithUnreadEntries
 
     def _retrieveEntriesForSelectedFeed(self, hideReadEntries):
-        viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(),
-            key=self.selectedFeed.id)
-        viewResults = list(viewResults)
+        viewResults = FeedEntry.entriesForFeed(self.selectedFeed, self.database)
         # TODO update date is a string ... convert to a ListDateTimeField for better sort support
         viewResults.sort(FeedEntry.compareByUpdateDate, reverse=True)
         if hideReadEntries:
-            viewResults = filter(lambda feedEntry: feedEntry.read == False, viewResults)
+            filterFunc = lambda feedEntry: feedEntry.read == False
+            viewResults = filter(filterFunc, viewResults)
         return viewResults
 
     def markSelectedFeedAsRead(self):