I'm having a weird error with some Google App Engine code I'm writing.
My program contains some code like this:
import datetime
...
class Action(db.Model):
visibleDate = db.DateTimeProperty()
...
getActionQuery = Action.gql("WHERE user = :user AND __key__ = :key", user = user, key = self.request.get("key"))
theAction = getActionQuery.get()
....
theAction.visibleDate = datetime.datetime.strptime(self.request.get("visibleDate"), "%Y/%m/%d")
Yet this produces the following error:
Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 509, in __call__ handler.post(*groups) File "/Users/redbird/Developer/betterdo-it/main.py", line 132, in post theAction.visibleDate = datetime.datetime.strptime(self.request.get("visibleDate"), "%Y/%m/%d"), File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 472, in __set__ value = self.validate(value) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 2308, in validate (self.name, self.data_type.__name__)) BadValueError: Property visibleDate must be a datetime
Any ideas on why this is happening? I've tested it and I know that my time is coming in, is getting converted correctly, but then hits this error.