3

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/time 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

ChrisJF
  • 6,822
  • 4
  • 36
  • 41
  • I did not really understand the question but if there is an event status, can't you just add an event listener? – dierre Aug 10 '10 at 14:55
  • 1
    possible duplicate of [Django - Set Up A Scheduled Job?](http://stackoverflow.com/questions/573618/django-set-up-a-scheduled-job) - the accepted answer for this question is how I'd do it. – Dominic Rodger Aug 10 '10 at 14:55

1 Answers1

3

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

ars
  • 120,335
  • 23
  • 147
  • 134