Using the actual DB ID instead of assuming it
This commit is contained in:
parent
996e61a8a0
commit
2ed612af28
1 changed files with 3 additions and 4 deletions
7
main.py
7
main.py
|
@ -67,10 +67,9 @@ def update_list():
|
||||||
importance.append(total_time[i] / remaining_time[i] * res[i][4])
|
importance.append(total_time[i] / remaining_time[i] * res[i][4])
|
||||||
if int(importance[i]) == 0:
|
if int(importance[i]) == 0:
|
||||||
importance[i] = 1
|
importance[i] = 1
|
||||||
print("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1))
|
print("Priority of Task ID " + str(i + 1) + " Set to: " + str(importance[i])) # res [i][0] = ID
|
||||||
print("Priority of Task ID " + str(i+1) + " Set to: " + str(importance[i]))
|
cur.execute("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), res[i][0]))
|
||||||
cur.execute("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1))
|
listbox.insert(tk.END, str(res[i][0]) + ":" + res[i][1])
|
||||||
listbox.insert(tk.END, str(res[i][0])+":"+ res[i][1])
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue