Reputation: 6845
How would you have a model object delete itself 60 seconds after it has been initialized? I know you could override the delete() method to have it sleep for 60 seconds before actually deleting the object. However, if I made a method call to delete() in a view. Wouldn't it just end up stalling the view for 60 seconds before continuing?
So how would I be able to do this without worrying about these stalls?
Upvotes: 0
Views: 1013
Reputation: 600026
Put a 'to_be_deleted' booleanfield in the model, and set up a cron job to run every 60 seconds to delete all instances with the flag set.
Upvotes: 3