Пример #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)