예제 #1
0
def editlink():
    if request.method == 'GET':
        ID = request.args.get('ID')
        where = ' and id=' + ID
        eresults = ToDoModel().list_items(where)
        results = ToDoModel().list_items()
        #print('eresults',eresults)
        return render_template('todo.html', eresults=eresults, results=results)
예제 #2
0
def edit():
    old_id = request.form['old_ID']
    title = request.form['Title']
    des = request.form['Description']
    date = request.form['DueDate']
    ToDoModel().sql_edit((title, des, date, old_id))
    return redirect(url_for('sql_database'))
예제 #3
0
def insert():
    if request.method == 'POST':
        title = request.form['Title']
        des = request.form['Description']
        Date = request.form['DueDate']
        ToDoModel().sql_edit_insert((title, des, Date))
        return redirect(url_for('sql_database'))
예제 #4
0
def delete():
    print("Inside delete")
    if request.method == 'GET':
        ID = request.args.get('ID')
        #print("lname",ID)
        ToDoModel().sql_delete((ID, ))
        return redirect(url_for('sql_database'))
예제 #5
0
def sql_database():

    results = ToDoModel().list_items()
    #print('results',results)
    return render_template('todo.html', results=results)