What the best solution in Django to solve this kind of problem:
I need to set a schedule time, based on an object attribute value, to run a "one time" task, when schedule time is reached.
For each attribute updates, the schedule time has to be also updated.
Example (pseudo code)
class Runner(models.Model):
execute_time = models.DateTimeField()
post_save( update_scheduler, sender=Runner)
def update_scheduler(sender, instance, created, **kwargs):
if created:
# set schedule time = instance.execute_time
create_or_update_schedule(instance.datetime)
Is it possibile to do something like this using Celery? update schedule time on object update?