#30036 closed Cleanup/optimization (fixed)
Code example for using Paginator in a view makes redundant imports
Reported by: | bhch | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The code example in this section:
Using Paginator in a view imports EmptyPage
and PageNotAnInteger
unnecessarily since Paginator.get_page()
handles these exceptions internally.
I had to spend some time figuring out why these were imported and never used. I even thought the code example might be incomplete, until I checked the source code.
I think it's better to remove these imports as they leave the reader confused.
Change History (5)
comment:1 by , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 6 years ago
Thanks Greg. I already have a patch ready. I just wanted to see if the OP wanted to make a contribution...
Yep. Thanks. Would you like to make a PR for these changes, whilst they're fresh in your mind?