示例#1
0
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)
示例#2
0
def todo_uncomplete():
    todos = Todo.all(complete=False)
    return render_json(todos)
示例#3
0
def todo_complete():
    todos = Todo.all(complete=True)
    return render_json(todos)
示例#4
0
def todo_index():
    log('all')
    todos = Todo.all()
    return render_json(todos)
示例#5
0
def delete_todo(id):
    t = Todo.delete(id)
    return render_json(t)
示例#6
0
def update_todo(id):
    form = request.get_json()
    t = Todo.update(id, **form)
    return render_json(t)
示例#7
0
def toggle_todo(id):
    t = Todo.toggle(id)
    return render_json(t)
示例#8
0
def add_todo():
    data = request.get_json()
    t = Todo.add(data)
    log('data', t)
    return render_json(t)