我有一个这样的模型:
class Users(db.Model):
email = db.EmailProperty(required=True, indexed=True)
user_name = db.StringProperty(required=True, indexed=True)
api_key = db.StringProperty(required=False, indexed=False)
active = db.BooleanProperty(required=True, indexed=False)
real_name = db.StringProperty(required=False, indexed=False)
...etc
当我尝试进行这样的查询时:
user = db.GqlQuery("SELECT email, api_key, active FROM Users WHERE user_name = :1", username).get()
它返回无,但是当我使用此查询时:
user = db.GqlQuery("SELECT * FROM Users WHERE user_name = :1", username).get()
没关系,一切都回来了。但为什么我不能使用第一个查询?