Example #1
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")
Example #2
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)