Search code examples
pythongoogle-app-enginedatastore

How to trigger datastore update if condition is met? (Google App Engine - Python)


In my application I have a column display with values y or n. Default value is n and the item is not displayed. When payment is received the value is changed to y and the item is displayed. If the item is not renewed in a month I would like to change it to n. How do I do this?


Solution

  • The tricky part if calculating the dates; I assume that you know how to change the value itself.

    You'll need to store the date of renewal, and check them periodically using Scheduled Tasks With Cron for Python or Java.

    Just create a job that changes all expired accounts to n after a certain time period (here, 1 month), and have it run every day, or every hour.