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
Add pagination #137
Add pagination #137
Conversation
Fix issue when page number is 0 inconsistent behaviour was experienced
Any Interest in this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great feature, hope it can get merged in!
Something I have problem with, The default build_path for pagination looks weird to me, I'd prefer something like:
Also the links from pager is not matched, you'd get "?page=2" |
I think you can use functools.partial to store the result of |
Check https://github.com/dozymoe/django-bakery/commit/5dbc0c46c045e13c082286e85461250fa43ec0b6 I have not updated the test or docs. |
Oops. The "?page=N" came from my django templates. |
Checkout my latest main branch: https://github.com/dozymoe/django-bakery/tree/main This will create pager url:
Something I am not clear about, is how Django construct full url, in my code I'd just make something like |
I'd use the standard Django method of adding pagination to a template, the build path is not necessarily the same as the url. |
I think my patch has problem with urls created by Django, as in it won't work with the dev server, still need fixes. I made https://github.com/dozymoe/frozen-django if anyone interested. It's dumb, can't export to AWS or static/media files, still a work in progress. |
Fixes #59
Pagination is handled like a django ListView, and templates should be designed in the same way.
When pagination is enabled the default build locations for the first page are: build_folder/build_path and /build_folder/build_page_name/1/build_path, with other pages only built in: /build_folder/build_page_name/<page_number>/build_path