comparison backend/couchdb/CouchDbBackend.py @ 175:57e324fa4350

implement getting a list of feeds that have unread entries
author dirk
date Fri, 09 Sep 2011 18:17:57 +0200
parents d0ced79b5030
children 7001070d0bd5
comparison
equal deleted inserted replaced
174:d0ced79b5030 175:57e324fa4350
36 # a ViewResults instance around which is not what we want 36 # a ViewResults instance around which is not what we want
37 self.feeds = list(Feed.all(self.database)) 37 self.feeds = list(Feed.all(self.database))
38 return self.feeds 38 return self.feeds
39 39
40 def _getUnreadFeeds(self): 40 def _getUnreadFeeds(self):
41 raise Exception("not yet implemented") 41 viewResults = self.database.view(CouchDb.feedsWithUnreadEntries(), group=True)
42 feeds = []
43 for row in viewResults:
44 feeds.append(Feed.load(self.database, row["key"]))
45 return feeds
42 46
43 def _retrieveEntriesForSelectedFeed(self, hideReadEntries): 47 def _retrieveEntriesForSelectedFeed(self, hideReadEntries):
44 # TODO how to hide read entries if requested? 48 # TODO how to hide read entries if requested?
45 viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(), 49 viewResults = FeedEntry.view(self.database, CouchDb.feedEntriesByFeed(),
46 key=self.selectedFeed.id) 50 key=self.selectedFeed.id)