Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CursorPaginator filters with the ordering attribute #9594

Open
LeOndaz opened this issue Nov 20, 2024 · 1 comment
Open

CursorPaginator filters with the ordering attribute #9594

LeOndaz opened this issue Nov 20, 2024 · 1 comment

Comments

@LeOndaz
Copy link

LeOndaz commented Nov 20, 2024

The current state is

def paginate_queryset(self, queryset, request, view=None):
            .....
            order_attr = order.lstrip('-')

            # Test for: (cursor reversed) XOR (queryset reversed)
            if self.cursor.reverse != is_reversed:
                kwargs = {order_attr + '__lt': current_position}
            else:
                kwargs = {order_attr + '__gt': current_position}

And I have backup_date and created_at, I want the cursor to act on backup_date, but filter with created_at

Am I doing it wrong?

@ahmedesmail07
Copy link

confirmed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants