annotate Feed.py @ 24:6b5ceffabe49

MainWindowController -> MainWindow
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 29 Apr 2010 05:43:57 +0200
parents 5fda8bd94fa8
children 5bb57caa8f66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
8a624ee48a74 First skeleton for sqlalchemy: define the mapping and create the first feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1
8a624ee48a74 First skeleton for sqlalchemy: define the mapping and create the first feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
2 class Feed(object):
16
3ffecc709da9 move fetch logic into Feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 7
diff changeset
3 @staticmethod
3ffecc709da9 move fetch logic into Feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 7
diff changeset
4 def all(session):
3ffecc709da9 move fetch logic into Feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 7
diff changeset
5 return session.query(Feed).order_by(Feed.title).all()
3ffecc709da9 move fetch logic into Feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 7
diff changeset
6
7
215c34f61e95 Feed.url -> Feed.rss_url
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 4
diff changeset
7 def __init__(self, title, rss_url):
215c34f61e95 Feed.url -> Feed.rss_url
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 4
diff changeset
8 self.title = title
215c34f61e95 Feed.url -> Feed.rss_url
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 4
diff changeset
9 self.rss_url = rss_url
2
8a624ee48a74 First skeleton for sqlalchemy: define the mapping and create the first feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10
8a624ee48a74 First skeleton for sqlalchemy: define the mapping and create the first feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 def __repr__(self):
7
215c34f61e95 Feed.url -> Feed.rss_url
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 4
diff changeset
12 return "<Feed (%d) %s>" % (self.pk, self.title)
17
5fda8bd94fa8 make the model used to display feeds generic (so it can be used to display FeedEntries, too)
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 16
diff changeset
13
5fda8bd94fa8 make the model used to display feeds generic (so it can be used to display FeedEntries, too)
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 16
diff changeset
14 def userPresentableString(self):
5fda8bd94fa8 make the model used to display feeds generic (so it can be used to display FeedEntries, too)
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 16
diff changeset
15 return self.title