comparison Mapping.py @ 35:aaec263f07ca

Feeds manage the point in time when the next update should happen. FeedUpdater only updates feeds that are due.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 05 May 2010 03:07:59 +0200
parents 5813e3c10f14
children 12ed8b5fa08c
comparison
equal deleted inserted replaced
34:5813e3c10f14 35:aaec263f07ca
26 metadata = MetaData(engine) 26 metadata = MetaData(engine)
27 27
28 feedTable = Table("feed", metadata, 28 feedTable = Table("feed", metadata,
29 Column("pk", Integer, primary_key=True), 29 Column("pk", Integer, primary_key=True),
30 Column("title", String(255), nullable=False), 30 Column("title", String(255), nullable=False),
31 Column("rss_url", String(255), nullable=False) 31 Column("rss_url", String(255), nullable=False),
32 Column("update_interval", Integer, nullable=False),
33 Column("next_update", DateTime, nullable=False)
32 ) 34 )
33 35
34 feedEntryTable = Table("feed_entry", metadata, 36 feedEntryTable = Table("feed_entry", metadata,
35 Column("pk", Integer, primary_key=True), 37 Column("pk", Integer, primary_key=True),
36 Column("create_timestamp", DateTime, nullable=False), 38 Column("create_timestamp", DateTime, nullable=False),
47 metadata.create_all() 49 metadata.create_all()
48 50
49 mapper(FeedEntry, feedEntryTable) 51 mapper(FeedEntry, feedEntryTable)
50 mapper(Feed, feedTable, 52 mapper(Feed, feedTable,
51 properties = { 53 properties = {
52 "entries" : relation(FeedEntry, backref = "feed") 54 "entries" : relation(FeedEntry, backref="feed")
53 } 55 }
54 ) 56 )