我有一个像这样的模型:
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()
返回的是 None,但当我使用这个查询时:
user = db.GqlQuery("SELECT * FROM Users WHERE user_name = :1", username).get()
没问题,返回了所有内容。但是为什么我不能使用第一个查询呢?