diff backend/couchdb/Feed.py @ 136:7217b060b39c

implement a Feed class that can be used to query feed and that wraps view results
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 23 Aug 2011 04:15:46 +0200
parents
children 2cd30af937fa
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/couchdb/Feed.py	Tue Aug 23 04:15:46 2011 +0200
@@ -0,0 +1,12 @@
+
+class Feed(object):
+    @staticmethod
+    def all(database):
+        viewResults = database.view("feedtest/feeds")
+        return [Feed(row) for row in viewResults]
+
+    def __init__(self, row):
+        self.row = row
+
+    def __getattr__(self, key):
+        return self.row.value[key]