假设我有:
class Like(db.Model):
user = db.ReferenceProperty(User,collection_name='likes')
photo = db.ReferenceProperty(Photo,collection_name='likes_received')
created = db.DateTimeProperty(auto_now_add=True)
是否可以运行仅返回照片键列表的投影查询?
photos = db.GqlQuery("SELECT photo FROM Like WHERE created < DATETIME(2013, 1, 1, 0, 0, 0)").fetch(10)
上面的代码产生:
BadValueError: Unsupported data type (<class 'models.Photo'>)