From a4678efc5cd96e57c462a57be02194916c9311cd Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sat, 3 Mar 2012 21:06:26 +0100 Subject: Like/Unlike an article is now working with MongoDB. --- mongodb.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mongodb.py') diff --git a/mongodb.py b/mongodb.py index 2360d1a1..3c03c8ed 100644 --- a/mongodb.py +++ b/mongodb.py @@ -122,7 +122,12 @@ class Articles(object): return unread_articles - + def like_article(self, like, feed_id, article_id): + """ + Like or unlike an article. + """ + collection = self.db[str(feed_id)] + collection.update({"article_id": article_id}, {"$set": {"article_like": like}}) def list_collections(self): """ -- cgit