comparison backend/sqlalchemy/Feed.py @ 167:a3c945ce434c

adjust the sqlalchemy backend to the changes in AbstractFeedUpdater
author dirk
date Mon, 05 Sep 2011 19:39:08 +0200
parents a4b2077c9603
children 7157bfd3f4d4
comparison
equal deleted inserted replaced
166:04c3b9796b89 167:a3c945ce434c
5 class Feed(object): 5 class Feed(object):
6 @staticmethod 6 @staticmethod
7 def all(session): 7 def all(session):
8 return session.query(Feed).order_by(Feed.title).all() 8 return session.query(Feed).order_by(Feed.title).all()
9 9
10 def __init__(self, title, rss_url): 10 def __init__(self, rss_url, title=None):
11 self.rss_url = rss_url
11 self.title = title 12 self.title = title
12 self.rss_url = rss_url
13 # default: update every 60 minutes 13 # default: update every 60 minutes
14 self.update_interval = 60 14 self.update_interval = 60
15 self.incrementNextUpdateDate() 15 self.incrementNextUpdateDate()
16 self.auto_load_entry_link = False 16 self.auto_load_entry_link = False
17 self.always_open_in_browser = False 17 self.always_open_in_browser = False
42 self.next_update = datetime.now() + delta 42 self.next_update = datetime.now() + delta
43 43
44 def markAllEntriesRead(self): 44 def markAllEntriesRead(self):
45 for entry in self.entries: 45 for entry in self.entries:
46 entry.markRead() 46 entry.markRead()
47 47
48 def takeChangesFrom(self, dict): 48 def takeChangesFrom(self, changes):
49 for key in dict.keys(): 49 for key in changes.keys():
50 setattr(self, key, dict[key]) 50 setattr(self, key, changes[key])