开发者

Call a method at a specific time for Django/Python?

In my Django web app, an event's status changes from 'upcoming' to 'completed' at a certain date/time. However, I want to update the database as soon as the event object's date/tim开发者_StackOverflow社区e has passed. Any ideas how I would code this?

My only idea so far is to have a thread constantly running that that checks to see if the event object's date/time as passed. However, this would be a really garbage way of doing things because there are potentially hundreds of event objects I would have to do this for.

Thanks for your help,

Chris


The django-chronograph app is one way to schedule jobs -- it relies on a cron job to automate scheduled running of django commands.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜