view 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 source


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]