Hi everyone. On one of my pages I would like to display a subset of a sorted list of objects. The entire list of relevant objects is extremely long and has a good chance of changing while the user is viewing the page. I don't mind that the page is not up to date, but I do need to ensure that when the user goes to the next page, the user will see the next n objects from the original sorted list. Thus, due to potentially changed data, using django's built in pagination or a really nice library like Django-endless-pagination will not return the correct results when going to the "next page".
To give an example of what I mean, say we have objects [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] and want to display 5 per page, sorted from small to big. The first page would look like:
1, 2, 3, 4, 5.
But while viewing this page, 3 and 4 were deleted. If we go to the "next" page, pagination will re-query the set and return:
8, 9, 10, 11, 12
I realize this is pagination's expected behavior, but I would like an easy way to make the next page display:
6, 7, 8, 9, 10
The most obvious solution is to do some client side pagination, and I realize there is a nice jquery library for this, but the number of objects can be potentially way too big for this solution to be realistic.
Is there a simple approach to paginate on a queryset and continue to use the results returned from that original queryset instead of re-fetching the queryset that may have changed?
Thanks for any insight you can give me!