diff Mapping.py @ 68:525a52169f60

Make FeedEntry table object available in Mapping to use it to expire old, read feed entries.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 10 Aug 2010 03:32:29 +0200
parents b535bce50626
children f909550683b0
line wrap: on
line diff
--- a/Mapping.py	Mon Aug 02 02:43:41 2010 +0200
+++ b/Mapping.py	Tue Aug 10 03:32:29 2010 +0200
@@ -15,6 +15,7 @@
 from sqlalchemy.orm import relation
 
 mappingDefined = False
+feedEntryTable = None
 
 def createMapping(engine):
     """ Make sure the mapping is defined only once. This is not really needed for the feed updater
@@ -26,6 +27,7 @@
 
 def _createMapping(engine):
     metadata = MetaData(engine)
+    metadata.bind = engine
     
     feedTable = Table("feed", metadata,
         Column("pk", Integer, primary_key=True),
@@ -38,6 +40,7 @@
         Column("auto_load_entry_link", Boolean, nullable=False)
     )
     
+    global feedEntryTable
     feedEntryTable = Table("feed_entry", metadata,
         Column("pk", Integer, primary_key=True),
         Column("create_timestamp", DateTime, nullable=False),