Mercurial > hg > Feedworm
comparison FeedList.py @ 72:e8c2730eb444
control the display of unread feeds/all feeds via Preferences
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 11 Aug 2010 03:23:02 +0200 |
parents | 228da10cc98b |
children | 5585f3d23541 |
comparison
equal
deleted
inserted
replaced
71:228da10cc98b | 72:e8c2730eb444 |
---|---|
1 | 1 |
2 from Feed import Feed | 2 from Feed import Feed |
3 from FeedEntry import FeedEntry | 3 from FeedEntry import FeedEntry |
4 from Preferences import Preferences | |
4 from sqlalchemy.orm import joinedload | 5 from sqlalchemy.orm import joinedload |
5 | 6 |
6 def getFeeds(session): | 7 def getFeeds(session): |
7 # return AllFeeds(session).getFeeds() | 8 preferences = Preferences(session) |
8 return UnreadFeeds(session).getFeeds() | 9 if preferences.showOnlyUnreadFeeds(): |
10 return UnreadFeeds(session).getFeeds() | |
11 else: | |
12 return AllFeeds(session).getFeeds() | |
9 | 13 |
10 class AllFeeds(object): | 14 class AllFeeds(object): |
11 '''A simple feed list that returns all feeds stored in the database''' | 15 '''A simple feed list that returns all feeds stored in the database''' |
12 | 16 |
13 def __init__(self, session): | 17 def __init__(self, session): |