I'm looking up a datastore entry in python by matching dates. What i want is pick the entry for "today" on each day. But for some reason when i upload my code to the gae server it'll work just for one day and on the next day it still returns the same value.
e.g. when i upload my code and execute it on 07-01-2014 it returns the value of 07-01-2014 but the next day on 08-01-2014 it still returns 07-01-2014.
If i redeploy the same code and execute it again it moves on to the 08-01-2014 but will again fail on the next day.
In my development environment it works fine...
Why? Thanks for your help!
class ClosingValueHandler(webapp2.RequestHandler):
def get(self):
sct()
(...)
def sct(from_date=datetime.datetime.now().date()):
value = getValueByDate(from_date)
def getValueByDate(date):
query = "SELECT * FROM Value WHERE date = DATE('%s')" % str(date)
try:
q = db.GqlQuery(query)
value = q.get()
except Exception as e:
logging.error("Could not fetch Value value for date '%s' \n Error message: %s \n" % (str(date), str(e)))
return
return value