photocrowd / django-cursor-pagination

Cursor-based pagination for Django
BSD 3-Clause "New" or "Revised" License
158 stars 27 forks source link

Has-previous doesn't work when paging forward. #17

Closed danpalmer closed 1 year ago

danpalmer commented 6 years ago

Given a set of 10 items, and the query "first 3 after 4", I'd expect the return value to have has_next=True and has_previous=True, but it only has has_next=True.

danpalmer commented 6 years ago

Ah, it looks like @moggers87 has already implemented this in #16. Could that be merged and released? Would be very handy as we're using this outside of Relay for the moment and need these values to be populated correctly.

moggers87 commented 6 years ago

FWIW, I'm not using this package for anything GraphQL related either

@danpalmer if you can't (or don't want to) install from git, it's fairly easy to work around this bug by subclassing the CursorPaginator and overriding the page method.

danpalmer commented 6 years ago

Thanks, good idea. I've included the PR patch locally in our code for now.

moggers87 commented 4 years ago

I think this issue can be closed now as #16 has been merged and released.