I'm writing software to help me prioritize tasks. It does this by looking through a database of tasks (tinyDB!), and calculating how valuable a task is (APV).
When testing, it is able to calculate the APV just fine. However, the update function does not seem to be working.
Here is code:
print("Final APV: " + str(currentAPV)) #tells me the final priority value, so I know it calculated right.
print(str(t.eid)) #tells me the eid of the task I'm on, so I know it's on the right task.
taskdb.update({"APV" : currentAPV}, eids = [t.eid]) #SHOULD update the value of that task's APV to what was calculated.
print("Actual written APV: " + str(t["APV"])) #tells me the APV of the task after updating, so I know it worked.
It results in this:
Final APV: 18.0 #correct
1 #also correct
Actual written APV: 0 #what the heck? did it not update?
Final APV: 18.0 #correct
2 #also correct
Actual written APV: 0 #same problem!