예제 #1
0
 def GET(self):
     todos = []
     itertodos = Todos.get_all()
     for todo in itertodos:
         todos.append({
             "id": todo.id,
             "title": todo.title,
             "order": todo._order,
             "done": todo.done == 1,
         })
     return json.dumps(todos)
예제 #2
0
 def GET(self):
     todos = []
     itertodos = Todos.get_all()
     for todo in itertodos:
         todos.append({
             "id": todo.id,
             "title": todo.title,
             "order": todo._order,
             "done": todo.done == 1,
         })
     return json.dumps(todos)
예제 #3
0
def getTodos():
    #get todos los datos de la base de datos.
    tasks = Todos.get_all()
    # devuelve el array de elementos serializado
    return jsonify_array(tasks), 200