I spent the night rewriting the routine to manually exclude the user from 
the query results. This is slower than I'd like it to be. The docs clearly 
state that cursors can be used with != if you place the model entity in the 
order along with the key attribute.

But it doesn't seem to work, it will work without the != operator, but not 
with it. So either the docs are incorrect or this is a bug.



On Monday, August 14, 2017 at 3:03:49 AM UTC+3, Richard Cheesmar wrote:
>
> I have an issue. I call a query with a cursor which is set to the Cursor() 
> first time around. I fetch 50 items from the query
>
> qry = cls.query(cls.store == store_id, cls.user != exclude_user, cls.active 
> == True, cls.offline == False).order(cls.user, cls._key, -cls.created)
>
> I return that qry to the calling class and run the following fetch
>
> result, next_cursor, more = qry.fetch_page(pagination, start_cursor=cursor)
>
> This works no problem, I then do the following with the cursor and pass it 
> back to the client as per the docs:
>
> client_params['next_page'] = next_cursor.urlsafe()
>
> I have logged this cursor to make sure it is the same on the return call to 
> the server, which it is
>
> I get it thus:
>
>  cursor = Cursor(urlsafe=page)
>
> However the second attempt to retrieve the next 50 or less items always 
> results in the following error:
>
> BadRequestError: cursor position is outside the range of the original query
>
> Now this whole process works fine on the local development machine but not in 
> production
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/37ace771-84f0-40e1-b4e6-e078a8c12843%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to