Opened 10 years ago

Closed 10 years ago

#2575 closed enhancement (fixed)

[patch] Make paginator work with lists and support orphans

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

(splitting #2093 into two seperate tickets)

There's no orphan feature for the paginator. For example:

22 records, num_per_page=10, orphan=2 --> pages==2, len(self.get_page(1))==12

The paginator should work with lists too.

The patch fixes these and also provides more accurate validation.

Attachments (2)

better_paginator.patch (5.2 KB) - added by Chris Beaven 10 years ago.
better_paginator.2.patch (5.1 KB) - added by Chris Beaven 10 years ago.
oops, typos

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Chris Beaven

Attachment: better_paginator.patch added

Changed 10 years ago by Chris Beaven

Attachment: better_paginator.2.patch added

oops, typos

comment:1 Changed 10 years ago by anonymous

Summary: [patch] Make Paginator works with lists and support orphans[patch] Make paginator work with lists and support orphans

comment:2 Changed 10 years ago by anonymous

and this hasn't been applied to the trunk because...?

comment:3 Changed 10 years ago by Chris Beaven

Patience is needed :)
As the FAQ says, it's a matter of prioritization and this is not a critical thing.

I do think that perhaps Django needs a few more developers with commit access.

comment:4 Changed 10 years ago by Chris Beaven

(#2576 is the other half of the original #2093 ticket)

comment:5 Changed 10 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [4041]) Fixed #2575: ObjectPaginator now accepts a "orphans" option to prevent pages with only a few items. Thanks, SmileyChris.

Note: See TracTickets for help on using tickets.
Back to Top