Mercurial > hg > Feedworm
comparison backend/couchdb/Feed.py @ 169:91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
author | dirk |
---|---|
date | Fri, 09 Sep 2011 14:52:54 +0200 |
parents | 04c3b9796b89 |
children | bb3c851b18b1 |
comparison
equal
deleted
inserted
replaced
168:f4708d38419c | 169:91a24f499318 |
---|---|
1 | 1 |
2 from couchdb.mapping import BooleanField, DateTimeField, Document, IntegerField, TextField | 2 from couchdb.mapping import BooleanField, DateTimeField, Document, IntegerField, TextField |
3 from datetime import datetime, timedelta | 3 from datetime import datetime, timedelta |
4 import CouchDb | |
4 | 5 |
5 class Feed(Document): | 6 class Feed(Document): |
6 doctype = TextField(default="feed") | 7 doctype = TextField(default="feed") |
7 title = TextField() | 8 title = TextField() |
8 rss_url = TextField() | 9 rss_url = TextField() |
11 auto_load_entry_link = BooleanField(default=False) | 12 auto_load_entry_link = BooleanField(default=False) |
12 always_open_in_browser = BooleanField(default=False) | 13 always_open_in_browser = BooleanField(default=False) |
13 | 14 |
14 @staticmethod | 15 @staticmethod |
15 def all(database): | 16 def all(database): |
16 return Feed.view(database, "feedtest/feeds") | 17 return Feed.view(database, CouchDb.feeds()) |
17 | 18 |
18 @staticmethod | 19 @staticmethod |
19 def create(url, title=None): | 20 def create(url, title=None): |
20 feed = Feed() | 21 feed = Feed() |
21 feed.rss_url = url | 22 feed.rss_url = url |