I have an app that stores entities with the owner's email. My models.py looks like this:
from google.appengine.ext import db
from google.appengine.api import users
class GenericModel(db.Model):
'''GenericModel is inherited by other model definitions.'''
DateAdded = db.DateTimeProperty(auto_now_add = True)
owner = db.UserProperty()
class CASentry(GenericModel):
description = db.TextProperty()
date = db.DateProperty()
hours = db.FloatProperty()
location = db.StringProperty()
When I run this from the interactive console on the development server:
from google.appengine.ext import db
t = db.GqlQuery('''SELECT * FROM CASentry''').fetch(1)[0]
print t.owner
t = db.GqlQuery('''SELECT * FROM CASentry where owner = 'test@example.com' ''').fetch(1)
print t
I get this:
test@example.com
[]
I feel expect something like this:
test@example.com
[<models.CASentry object at 0x123456>]
Can anyone see a problem with my code?