Opened 17 years ago

Closed 13 years ago

#6860 closed New feature (wontfix)

Improvements for the new paginator

Reported by: Alberto García Hierro <fiam@…> 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)

0005-Improve-the-new-paginator.diff (6.1 KB ) - added by Alberto García Hierro <fiam@…> 17 years ago.
0005-Improve-the-new-paginator.2.diff (5.9 KB ) - added by Alberto García Hierro <fiam@…> 17 years ago.
Improved version of the patch

Download all attachments as: .zip

Change History (7)

by Alberto García Hierro <fiam@…>, 17 years ago

by Alberto García Hierro <fiam@…>, 17 years ago

Improved version of the patch

comment:1 by Jeff Anderson, 16 years ago

Needs documentation: set
Triage Stage: UnreviewedDesign 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 Julien Phalip, 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 Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:5 by Carl Meyer, 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 Carl Meyer, 13 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top