我明白了:
AttributeError: 'list' object has no attribute 'cursor'
在这条线上:
company_cursor = companies.cursor()
运行以下代码时:
q = Company.all()
q.order("datetime")
companies = q.fetch(5)
company_cursor = memcache.get("company_cursor")
if company_cursor:
companies.with_cursor(start_cursor = company_cursor)
for company in companies:
do_stuff(company)
company_cursor = companies.cursor()
memcache.set("company_cursor",company_cursor, 11000)
据我所见,我的代码类似于此处显示的示例:
https://developers.google.com/appengine/docs/python/datastore/queries。