changeset 6:87317ba41816

add a creation date for the feed entry
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 27 Apr 2010 02:30:50 +0200
parents bfd47f55d85b
children 215c34f61e95
files FeedEntry.py Mapping.py feedupdate-main.py
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/FeedEntry.py	Mon Apr 26 20:46:37 2010 +0200
+++ b/FeedEntry.py	Tue Apr 27 02:30:50 2010 +0200
@@ -1,3 +1,5 @@
+
+from datetime import datetime
 
 class FeedEntry(object):
     @staticmethod
@@ -6,7 +8,7 @@
         return result.first()
 
     def __init__(self):
-        pass
+        self.create_timestamp = datetime.now()
 
     def __repr__(self):
         return "<FeedEntry (%d) %s>" % (self.pk, self.link)
--- a/Mapping.py	Mon Apr 26 20:46:37 2010 +0200
+++ b/Mapping.py	Tue Apr 27 02:30:50 2010 +0200
@@ -22,6 +22,8 @@
     
     feedEntryTable = Table("feed_entry", metadata,
         Column("pk", Integer, primary_key=True),
+        Column("create_timestamp", DateTime, nullable=False),
+
         Column("id", String(255), nullable=False),
         Column("link", String(255), nullable=False),
         Column("title", String, nullable=False),
--- a/feedupdate-main.py	Mon Apr 26 20:46:37 2010 +0200
+++ b/feedupdate-main.py	Tue Apr 27 02:30:50 2010 +0200
@@ -36,6 +36,6 @@
     SessionMaker = sessionmaker(bind = engine)
     session = SessionMaker()
     
-    #createFeed(session)
-    #updateAllFeeds(session)
-    listFeeds(session)
+    createFeed(session)
+    updateAllFeeds(session)
+    #listFeeds(session)