Skip to content

Pagination#53

Draft
sergiusnick wants to merge 1 commit intoem1208:mainfrom
sergiusnick:pagination
Draft

Pagination#53
sergiusnick wants to merge 1 commit intoem1208:mainfrom
sergiusnick:pagination

Conversation

@sergiusnick
Copy link
Copy Markdown
Contributor

#51

pagination
@B-ug
Copy link
Copy Markdown

B-ug commented Dec 23, 2024

使用PageNumberPagination抛出了django.core.exceptions.SynchronousOnlyOperation异常

@em1208
Copy link
Copy Markdown
Owner

em1208 commented Dec 28, 2024

@sergiusnick Thanks for your contribution. I need some time to review this, would it be possible for you to add a few test cases? Thanks again.

self.display_page_controls = True

if self.count == 0 or self.offset > self.count:
return []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used this implementation of LimitOffsetPagination successfully. The only change I needed was to this empty response so you can always use async for on it.

Suggested change
return []
return queryset.none()

@paulocoutinhox
Copy link
Copy Markdown

+1

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

Successfully merging this pull request may close these issues.

5 participants