使用分页游标进行投影查询?

时间:2013-03-14 03:57:09

标签: python google-app-engine app-engine-ndb

不确定这是一个错误还是我遇到的一些概念上的误解。我想要做的基本上是设置文档here中概述的prev和next分页游标,除了我希望查询是投影查询。这可能吗?例如:

# Set up.
q = Bar.query()
q_forward = q.order(Bar.key)
q_reverse = q.order(-Bar.key)

# Fetch a page going forward.
bars, cursor, more = q_forward.fetch_page(10, start_cursor=initial_cursor, projection=my_projection)

# Fetch the same page going backward.
rev_cursor = cursor.reversed()
bars1, cursor1, more1 = q_reverse.fetch_page(10, start_cursor=rev_cursor, projection=my_projection)

当我做这样的事情时,我得BadRequestError: Cursor does not match query运行第二个fetch_page(反转光标上的那个)。

0 个答案:

没有答案