开发者

django generic view pagination by item id (not page number)

I love the ease of django's pagination system, but is there anyway to tweak it where it's paginating by item id instead of page number? Because I am ordering in descending order, if there is an update on a page while a user is goi开发者_如何转开发ng through the pages, the ordering is off.

For instance, if each page had 3 items

  1. Item #1
  2. Item #2
  3. Item #3

While reading page 1, another user updates, then page 2 for the current user will be

  1. Item #3
  2. Item #4
  3. Item #5


Short answer: No.

To do this you'll need to write your own pagination system; Django's is designed to work with any list-like set of data and the page number system is intractably built in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜