Exemple #1
0
def tasks():
    tasks = task_repository.select_all()  # NEW
    return render_template("tasks/index.html", all_tasks=tasks)


# NEW
# GET '/tasks/new'

# CREATE
# POST '/tasks'

# SHOW
# GET '/tasks/<id>'

# EDIT
# GET '/tasks/<id>/edit'

# UPDATE
# PUT '/tasks/<id>'

# DELETE
# DELETE '/tasks/<id>'
Exemple #2
0
def tasks():
    tasks = task_repository.select_all()  # NEW
    return render_template("tasks/index.html", all_tasks=tasks)
Exemple #3
0
import pdb
from models.task import Task
import repositories.task_repository as task_repository

task_repository.delete_all()

task_1 = Task("Walk Dog", "Jack Jarvis", 60)

task_2 = Task("Feed Cat", "Victor McDade", 5)

print(task_1.__dict__)

task_repository.save(task_1)

res = task_repository.select_all()

for task in res:
    print(task.__dict__)

pdb.set_trace()
def tasks():
    # get all the tasks
    tasks = task_repository.select_all()
    # return an HTML view listing all the tasks
    return render_template("tasks/index.html", all_tasks=tasks)