0
我有以下代碼:如何在GAE上使用投影?
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'
但如果我正確讀取the doc,它應該得到支持。
謝謝。我使用1.5.4,所以這是原因。 –