Example #1
0
 def delete(self, id):
     try:
         project = Session.query(Project).filter_by(id=id).one()
     except:
         abort(404)
     if "_method" in request.params and request.params["_method"] == "DELETE":
         Session.delete(project)
         Session.commit()
         # TODO flash a message saying the project was deleted
         return redirect("/projects")
     return render("projects/delete.html", {"project": project})
Example #2
0
 def delete(self, id):
     try:
         tasklist = Session.query(TaskList).filter_by(id=id).one()
     except:
         abort(404)
     if "_method" in request.params and request.params["_method"] == "DELETE":
         Session.delete(tasklist)
         Session.commit()
         # TODO flash a message
         return redirect("/projects/show/%s" % tasklist.project.id)
     return render("tasklists/delete.html", {"tasklist": tasklist})