Opened 17 years ago
Closed 13 years ago
#6860 closed New feature (wontfix)
Improvements for the new paginator
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | paginator |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
This patch adds methods for storing the base_url and retrieving it, displaying the page list as ul or div (taking the current page into account) as well as for obtaining the links for the previous and next pages. I've not included any documentation, because I want to get some feedback about the code itself before writing any doc.
Attachments (2)
Change History (7)
by , 17 years ago
Attachment: | 0005-Improve-the-new-paginator.diff added |
---|
by , 17 years ago
Attachment: | 0005-Improve-the-new-paginator.2.diff added |
---|
comment:1 by , 17 years ago
Needs documentation: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
This looks useful, and would probably clean up views that use the paginator.
The patch applies beautifully to current trunk.
comment:3 by , 14 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
This seems useful but the patch is old and needs to be updated. Also needs tests.
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
UI/UX: | unset |
Discussion with Alex: the PageList object hardcodes a bunch of HTML in Python strings, which is not ok. The page_or_404 method and the base_url, next url, previous url stuff break the conceptual boundary of the Paginator object, so it no longer just paginates a sequence of objects, but now also has (rudimentary) knowledge of how URLs are constructed to reach those objects.
These problems are solved more cleanly by third-party packages such as django-pagination, that wrap more sophisticated URL logic and display utilities around the core Paginator rather than extending it in a way that breaks its conceptual simplicity. And it makes sense to leave such packages outside core, because how page numbering is displayed and how pagination URLs are handled is a matter of preference that will vary between projects.
comment:6 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Improved version of the patch