Exemplo n.º 1
0
    def post(self, task_id):
        task = Tasks.get_by_id(int(task_id))
        task.archived = False
        task.put()
        time.sleep(0.1)

        return self.redirect_to("tasks")
Exemplo n.º 2
0
 def post(self, task_id):
     edited = self.request.get("edit")
     task = Tasks.get_by_id(int(task_id))
     task.task = edited
     task.put()
     time.sleep(0.1)
     return self.redirect_to("tasks")
Exemplo n.º 3
0
    def post(self, task_id):
        task = Tasks.get_by_id(int(task_id))
        task.archived = False
        task.put()
        time.sleep(0.1)

        if Tasks.query(Tasks.archived == True).fetch():
            return self.redirect_to("archived")
        else:
            return self.redirect_to("tasks")
Exemplo n.º 4
0
    def get(self, task_id):
        task = Tasks.get_by_id(int(task_id))
        task.archived = True
        task.put()
        time.sleep(0.1)

        tasks = Tasks.query(Tasks.archived == False).fetch()
        tasks.sort(key=lambda r: r.date, reverse=True)

        params = {"tasks": tasks,
                  "task_id": task_id}

        return self.render_template("archive_task.html", params=params)
Exemplo n.º 5
0
 def get(self, task_id):
     task = Tasks.get_by_id(int(task_id))
     params = {"task": task}
     return self.render_template("edit_task.html", params=params)
Exemplo n.º 6
0
    def post(self, task_id):
        task = Tasks.get_by_id(int(task_id))
        task.key.delete()
        time.sleep(0.1)

        return self.redirect_to("tasks")