Django: How to automatically change a field's value at the time mentioned in the same object?
问题 I am working on a django project for racing event in which a table in the database has three fields. 1)Boolean field to know whether race is active or not 2)Race start time 3)Race end time While creating an object of it,the start_time and end_time are specified. How to change the value of boolean field to True when the race starts and to False when it ends? How to schedule these activities? 回答1: To automatically update a model field after a specific time, you can use Celery tasks. Step-1: