hw_todo/utils.py
def check_if_exists(canvas_id):
    """
    Helper Method
    Checks if a given canvas assignment already exists in the db
    :return: Boolean (True if exists in db, False if not)
    """
    existing_tasks = Todo.query.all()
    for task in existing_tasks:
        if task.canvas_id == canvas_id:
            return task.id
    return -1

    Helper Method
    Checks if a given canvas assignment already exists in the db
    :return: Boolean (True if exists in db, False if not)
    
Helper Method
Checks if a given canvas assignment already exists in the db
Helper Method Checks if a given canvas assignment already exists in the db
def check_if_exists(canvas_id):
    existing_tasks = Todo.query.all()
    for task in existing_tasks:
        if task.canvas_id == canvas_id:
            return task.id
    return -1
def check_if_exists ( canvas_id ) : existing_tasks = Todo . query . all ( ) for task in existing_tasks : if task . canvas_id == canvas_id : return task . id return - 1
Helper Method
Checks if a given canvas assignment already exists in the db
Helper Method Checks if a given canvas assignment already exists in the db
"""
    Helper Method
    Checks if a given canvas assignment already exists in the db
    :return: Boolean (True if exists in db, False if not)
    """
Boolean (True if exists in db, False if not)
Boolean ( True if exists in db False if not )
canvas_id