diff backend/couchdb/CouchDbBackend.py @ 148:c5a427d46703

displaying entries for a feed works now with the couchdb backend
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 26 Aug 2011 06:13:39 +0200
parents 8ec20377bcb0
children a05719a6175e
line wrap: on
line diff
--- a/backend/couchdb/CouchDbBackend.py	Thu Aug 25 11:05:05 2011 +0200
+++ b/backend/couchdb/CouchDbBackend.py	Fri Aug 26 06:13:39 2011 +0200
@@ -24,7 +24,9 @@
         if self.preferences().showOnlyUnreadFeeds():
             return self._getUnreadFeeds()
         else:
-            return Feed.all(self.database)
+            # make sure that the results are actually fetched into memory, otherwise we'll pass
+            # a ViewResults instance around which is not what we want
+            return list(Feed.all(self.database))
 
     def _getUnreadFeeds(self):
         raise Exception("not yet implemented")
@@ -48,8 +50,7 @@
         viewName = "feedtest/feedEntries_by_feed"
         if hideReadEntries:
             viewName = "feedtest/unread_feedEntries_by_feed"
-        viewResults = self.database.view(viewName)
-        return [FeedEntry(row) for row in viewResults]
+        return list(FeedEntry.view(self.database, viewName))
 
     def markFeedEntriesAsRead(self, entries):
         raise Exception("not yet implemented")