0

我有以下代码:

employees = Employee.all()
employees.projection('first_name')
employees.filter('passport_id =', passport_id)
employees.order('-added')
results = employees.fetch(5)

不允许第二行:

AttributeError: 'Query' object has no attribute 'projection'

另一种方法也返回错误:

    employees = db.Query(Employee, projection=('first_name'))
TypeError: __init__() got an unexpected keyword argument 'projection'

但是,如果我正确阅读了文档,则应该支持它。

4

1 回答 1

1

您正在运行哪个版本的 AppEngine SDK?在1.6.5 版本中添加了投影查询

于 2012-07-01T16:11:35.203 回答