Django: How to automatically change a field's value at the time mentioned in the same object?

后端 未结 5 1110
抹茶落季
抹茶落季 2020-12-23 23:01

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)

5条回答
  •  春和景丽
    2020-12-23 23:41

    Is there any reason you wouldn't just calculate the boolean field in your business logic? i.e. when you receive a request related to that race, simply check the times and assess whether or not the race is active (for display, analysis), etc.

    I'm assuming you won't have high load (one reason for pre-processing) like this.

提交回复
热议问题