def comment_add(): form = request.get_json() log(form) todo = Todo.one(id=form['id']) if todo is not None: c = Comment.add(form) return render_json(c)
def todo_uncomplete(): todos = Todo.all(complete=False) return render_json(todos)
def todo_complete(): todos = Todo.all(complete=True) return render_json(todos)
def todo_index(): log('all') todos = Todo.all() return render_json(todos)
def delete_todo(id): t = Todo.delete(id) return render_json(t)
def update_todo(id): form = request.get_json() t = Todo.update(id, **form) return render_json(t)
def toggle_todo(id): t = Todo.toggle(id) return render_json(t)
def add_todo(): data = request.get_json() t = Todo.add(data) log('data', t) return render_json(t)