Ejemplo n.º 1
0
 def post(self, opinion_id):
     opinion = Opinion.get_by_id(int(opinion_id))
     opinion.name = self.request.get("name")
     opinion.email = self.request.get("email")
     opinion.opinion = self.request.get("opinion")
     opinion.put()
     return self.redirect("/opinions")
Ejemplo n.º 2
0
 def post(self, opinion_id):
     opinion = Opinion.get_by_id(int(opinion_id))
     opinion.deleted = True
     opinion.put()
     return self.redirect("/opinions")
Ejemplo n.º 3
0
 def get(self, opinion_id):
     opinion = Opinion.get_by_id(int(opinion_id))
     params = {"opinion": opinion}
     return self.render_template("delete-opinion.html", params)
Ejemplo n.º 4
0
 def post(self, opinion_id):
     opinion = Opinion.get_by_id(int(opinion_id))
     opinion.key.delete()
     return self.redirect("/deleted")
Ejemplo n.º 5
0
 def get(self, opinion_id):
     if not users.is_current_user_admin():
         return self.write("You are not admin!")
     opinion = Opinion.get_by_id(int(opinion_id))
     params = {"opinion": opinion}
     return self.render_template("complete-delete.html", params)