Explorar el Código

delete/undelete

David hace 10 años
padre
commit
0061a32d59
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      db.py

+ 4 - 2
db.py

@@ -73,8 +73,10 @@ class db():
         return self.jsonable(ret)
 
     def delete_article(self,artid):
-        self.c_articles.update({"_id":ObjectId(artid)},{"$set":{"deleted":True}})
-        return True
+        return self.c_articles.update({"_id":ObjectId(artid)},{"$set":{"deleted":True}})
+
+    def undelete_article(self,artid):
+        return self.c_articles.update({"_id":ObjectId(artid)},{"$set":{"deleted":False}})
 
     def sources(self,id=None):
         if id is None: