Mercurial > hg > Feedworm
diff backend/couchdb/FeedEntry.py @ 144:74217db92993
updating feeds on the couchdb backend works now
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 24 Aug 2011 11:54:06 +0200 |
parents | |
children | b290e29a94b5 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/FeedEntry.py Wed Aug 24 11:54:06 2011 +0200 @@ -0,0 +1,18 @@ + +class FeedEntry(object): + @staticmethod + def findByLink(link, database): + viewResults = database.view("feedtest/feedEntry_by_link") + resultsForKey = viewResults[link] + try: + row = iter(resultsForKey).next() + return FeedEntry(row) + except StopIteration: + return None + + def __init__(self, row): + self.row = row + + def __getattr__(self, key): + return self.row.value[key] +