Commit 31850094 authored by ale's avatar ale

fixes for sqlalchemy 0.5

parent 86d8b803
......@@ -29,7 +29,6 @@ class Feed(object):
f = cls.query.filter_by(url=url).first()
if not f:
f = cls(url=url)
Session.save(f)
else:
if (now - f.updated_at) < timedelta(0, 600):
return f.data
......@@ -48,7 +47,7 @@ class Feed(object):
f.last_modified = datetime.fromtimestamp(time.mktime(response.modified))
f.data = FeedData(feed=response.feed, entries=response.entries)
f.updated_at = now
Session.update(f)
Session.add(f)
Session.commit()
return f.data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment