Mercurial > hg > Feedworm
annotate FeedEntry.py @ 24:6b5ceffabe49
MainWindowController -> MainWindow
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 29 Apr 2010 05:43:57 +0200 |
parents | 0b8398ca6cd0 |
children | 74481aa49974 |
rev | line source |
---|---|
6
87317ba41816
add a creation date for the feed entry
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
5
diff
changeset
|
1 |
87317ba41816
add a creation date for the feed entry
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
5
diff
changeset
|
2 from datetime import datetime |
4
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 class FeedEntry(object): |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 @staticmethod |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 def findById(id, session): |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 result = session.query(FeedEntry).filter(FeedEntry.id == id) |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 return result.first() |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 |
5
bfd47f55d85b
add the updated date of the feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
4
diff
changeset
|
10 def __init__(self): |
6
87317ba41816
add a creation date for the feed entry
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
5
diff
changeset
|
11 self.create_timestamp = datetime.now() |
4
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 |
e0199f383442
retrieve a feed for the given URL, store entries as feed_entry rows into the database
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 def __repr__(self): |
20 | 14 return "<FeedEntry (%d) %s>" % (self.pk, self.title) |
18
35225588b895
add a list view for displaying feed entries from the selected feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
6
diff
changeset
|
15 |
35225588b895
add a list view for displaying feed entries from the selected feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
6
diff
changeset
|
16 def userPresentableString(self): |
35225588b895
add a list view for displaying feed entries from the selected feed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
6
diff
changeset
|
17 return self.title |