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

There is a mistake in the example. #56

Open
istarmeow opened this issue Jan 24, 2019 · 2 comments
Open

There is a mistake in the example. #56

istarmeow opened this issue Jan 24, 2019 · 2 comments

Comments

@istarmeow
Copy link

https://github.com/jamespacileo/django-pure-pagination

in this page, "Usage example"

try:
    page = request.GET.get('page', 1)
except PageNotAnInteger:
    page = 1

It's not going to cause an anomaly here.

I think this should be done in the following examples

        page = request.GET.get('page', 1)
        p = Paginator(all_article, 8)

        try:
            all_article_page = p.page(number=page)
        except PageNotAnInteger:
            # page = 1
            all_article_page = p.page(number=1)
        except EmptyPage:
            # page = p.num_pages
            all_article_page = p.page(number=p.num_pages)
@owgreen
Copy link

owgreen commented Apr 7, 2019

This is exactly what I've noticed. Hope this fix will be merged soon.

@k704790
Copy link

k704790 commented Aug 1, 2019

great, this helps to fix my error. Tks.

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

3 participants