Closed bdauer closed 7 years ago
Consider copying the pk of the original task into a separate field for tracking the relationship
The pk isn't accessible from CreateTaskView
's form_valid
method, I think because it's autogenerated by the database. That means I'll need to look into a different solution, maybe using a signal. I need to assign the shared id before calling Task.add_next_recurring_date()
. Otherwise the next date won't have the shared id.
I tried using a signal, triggered by the form's post_save
based off of the idea that the form would still behave as a model. That didn't work out. After a little more sleuthing I decided to generate a UUID. The related recurring tasks are now linked up!
The same recurring tasks should have a shared ID so that it's possible to track their relationship. That way, if the task is removed by the user, all instances will be removed.
It probably shouldn't be the name of the task because two tasks could exist with the same name.