Home > database >  Update Database column after every 30 days in django
Update Database column after every 30 days in django

Time:03-30

I am creating a Django application where my requirement is that for each user I have a boolean value which is set to False by default. Now if the user completes a particular task then the value change to true. Now after 30 days from the value changed to true the value should be updated to false.

i.e user completes a task and then the value changes to true and remains to true for 30 days and then the value changes to false after 30 days automatically. How can I achieve this in Django?

CodePudding user response:

You would need some type of trigger, for example the user logging in. So when the user logs in you check if it has been 30 days since the value changed to True, and if so, you change the value back to False before logging the user in.

  • Related