diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-03-01 03:20:12 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-03-03 22:23:02 +0100 |
commit | 5572851eca3b2f1bc56aed7232284acc436d2f49 (patch) | |
tree | b8f425333804ca06a4a16600b4c4c0bfcdf4cff7 /pyaggr3g470r/models | |
parent | continuing refacto (diff) | |
download | newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.tar.gz newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.tar.bz2 newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.zip |
new crawler with cache control and error handling
Diffstat (limited to 'pyaggr3g470r/models')
-rw-r--r-- | pyaggr3g470r/models/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyaggr3g470r/models/__init__.py b/pyaggr3g470r/models/__init__.py index 27ee18b6..25273036 100644 --- a/pyaggr3g470r/models/__init__.py +++ b/pyaggr3g470r/models/__init__.py @@ -116,7 +116,8 @@ class Feed(db.Model): # cache handling etag = db.Column(db.String(), default="") - last_modified = db.Column(db.DateTime(), default=datetime(1970, 1, 1)) + last_modified = db.Column(db.String(), default="") + last_retreived = db.Column(db.DateTime(), default=datetime(1970, 1, 1)) # error logging last_error = db.Column(db.String(), default="") @@ -138,7 +139,9 @@ class Feed(db.Model): "link": self.link, "site_link": self.site_link, "etag": self.etag, - "last_modified": self.last_modified} + "error_count": self.error_count, + "last_modified": self.last_modified, + "last_retreived": self.last_retreived} class Article(db.Model): @@ -154,7 +157,6 @@ class Article(db.Model): like = db.Column(db.Boolean(), default=False) date = db.Column(db.DateTime(), default=datetime.now) retrieved_date = db.Column(db.DateTime(), default=datetime.now) - guid = db.Column(db.String(), default="") user_id = db.Column(db.Integer, db.ForeignKey('user.id')) feed_id = db.Column(db.Integer, db.ForeignKey('feed.id')) |