-
Notifications
You must be signed in to change notification settings - Fork 423
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
Table.page handle incorrect page number #68
Comments
I hadn't thought about this before, but I totally agree. I think I feel like perhaps One possible pattern would be to just require
I'm not sure how the |
Yes, I agree moving With the |
Any thoughts on the |
Something along the lines of "page_out_of_bounds_action"(=404/page1/...) ? But thats terribly long.... |
|
Hi,
Are there any thoughts yet on changing the handling of invalid page numbers to provide a default behaviour (empty table/first page/HttpRedirect/..)?
In the django documentation (https://docs.djangoproject.com/en/dev/topics/pagination/?from=olddocs#using-paginator-in-a-view) is a reference implementatoin which handels the EmptyPage and PageNotAnInteger exceptions accordingly.
In my current straight forward use case (example code below) I'd have to catch the Http404 Exception raised by the Paginator during the render() call, call table.page() and handle the 2 exceptions accordingly which doesn't feel very good. I could also implement an own Paginator (derived from django.core.Paginator) which does the handling but still feels like a bit too much "work".
It would also be alot more uglier with multiple tables on the same page..
My proposal would be some sort of Meta options flag on how to handle invalid page numbers.
The text was updated successfully, but these errors were encountered: