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)
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'))
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'))
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'))
def sql_database(): results = ToDoModel().list_items() #print('results',results) return render_template('todo.html', results=results)