예제 #1
0
def save_complete():
    timestamp = request.form['task_complete']
    db = model_ar.connect_db()
    task_query = model_ar.complete_task(db, timestamp)
    return redirect("/tasks")
예제 #2
0
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) 
예제 #3
0
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")
예제 #4
0
"""
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)