def save_complete(): timestamp = request.form['task_complete'] db = model_ar.connect_db() task_query = model_ar.complete_task(db, timestamp) return redirect("/tasks")
def list_tasks(): db = model_ar.connect_db() # connect to database tasks_from_db = model_ar.get_tasks(db, ) #gets a list of all tasks return render_template("list_tasks.html", tasks=tasks_from_db)
def save_task(): task_title = request.form['task_title'] db = model_ar.connect_db() #Assume all tasks are attached to user 1. task_id = model_ar.new_task(db, task_title, 1) return redirect("/tasks")
""" seed.py """ import model_ar db = model_ar.connect_db() task_user_id = model_ar.new_user(db, "spongebob@squarepants", "ilovesandy", "SBSQ") task = model_ar.new_task(db, "look at sunshine", task_user_id)