예제 #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)