django-cursor-pagination icon indicating copy to clipboard operation
django-cursor-pagination copied to clipboard

Cursor-based pagination for Django

Results 11 django-cursor-pagination issues
Sort by recently updated
recently updated
newest added

The code that I'm using is very similar to the example provided in the README: ``` qs = Vendor.objects.filter(client__pk=client_id) page_size = 2 paginator = CursorPaginator(qs, ordering=('-completed_date', '-id')) page = paginator.page(first=page_size,...

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`.

This PR aims to add support for querysets created with `.values(...)`. In such case, `position_from_instance(self, instance)` recieve a `dict` instead of a ORM object, therefore failing at line 131 with...

I'd like to use the cursors in the query string, but they currently aren't url safe, so some of the characters are url-encoded. The goal of this diff is to...

### Duplicate the exact "after" cursor item, when get next page.

Since the direction of the sorts are checked assuming they are strings ([source](https://github.com/photocrowd/django-cursor-pagination/blob/13ec85507894daf8f0a7ee8727964a1242009281/cursor_pagination.py#L70)), attempting to use an OrderBy object will cause a crash. The use of an OrderBy object is...

We need to ensure that only the last field is `__lt` or `__gt`, the previous ones should be `__lte`. As an example, order on `('a', 'b')`, page at 2. Data:...

`CursorPaginator` takes 2 parameters `queryset` and `ordering` and applies the `ordering` to the `queryset` on init. However, if a query set is already adequately ordered for pagination purposes, either explicitly...

enhancement

In this project at the moment I have not used the `offset` approach which used by Django rest framework and inspired by David Cramer's blog post. The main reason for...