[Django] #22731: page number variable update in docs for paginator

5 views
Skip to first unread message

Django

unread,
May 29, 2014, 6:34:06 PM5/29/14
to django-...@googlegroups.com
#22731: page number variable update in docs for paginator
--------------------------------------+-----------------------
Reporter: joeyliechty@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords: paginator
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+-----------------------
https://docs.djangoproject.com/en/dev/topics/pagination/#using-paginator-
in-a-view

In this chunk of the documentation, perhaps it would be beneficial to also
update the page number variable.
Something like this:

{{{
page = request.GET.get('page')
try:
contacts = paginator.page(page)
except PageNotAnInteger:
# If page is not an integer, deliver first page.
contacts = paginator.page(1)
page = 1
except EmptyPage:
# If page is out of range (e.g. 9999), deliver last page of
results.
contacts = paginator.page(paginator.num_pages)
page = paginator.num_pages
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22731>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 2, 2014, 7:44:07 AM6/2/14
to django-...@googlegroups.com
#22731: page number variable update in docs for paginator
-------------------------------------+-------------------------------------
Reporter: joeyliechty@… | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: 1.6
Component: Documentation | Resolution: wontfix
Severity: Normal | Triage Stage:
Keywords: paginator | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0


Comment:

Please reopen if I've missed something, but I don't see the point in
updating the variable when it's not used in any code that follows.

--
Ticket URL: <https://code.djangoproject.com/ticket/22731#comment:1>

Reply all
Reply to author
Forward
0 new messages