def post(self): if self.request.get('post_id') != "0": idea_target = Idea.get(db.Key.from_path('Idea', int(self.request.get('post_id')))) idea_target.idea_edit(self.request.get('content')) elif self.request.get('reply_id') != "0": idea_target = Idea.get(db.Key.from_path('Idea', int(self.request.get('reply_id')))) reply_idea = idea_create(self.request.get('content'), idea_target) else: new_idea = idea_create(self.request.get('content'), None) self.redirect('/')
def post(self): #idea_target = Idea.get_by_id(int(self.request.get('idea_id'))) idea_target = Idea.get(db.Key.from_path('Idea', int(self.request.get('idea_id')))) # idea_delete(idea_target) is not work # idea_target.delete() is work idea_target.idea_delete_content() idea_target.put() self.redirect('/')