Opened 15 years ago

Closed 14 years ago

#11596 closed New feature (fixed)

paginator Page should be iterable

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

Description

It's annoying that you can't iterate a PaginatorPage directly. Solution, make it a subclass of list.

Attachments (3)

11596.diff (770 bytes ) - added by Chris Beaven 15 years ago.
11596.2.diff (2.0 KB ) - added by Chris Beaven 14 years ago.
11596.3.diff (3.4 KB ) - added by Chris Beaven 14 years ago.
with docs

Download all attachments as: .zip

Change History (8)

by Chris Beaven, 15 years ago

Attachment: 11596.diff added

comment:1 by Chris Beaven, 15 years ago

Keywords: paginate added
Owner: changed from nobody to Chris Beaven
Status: newassigned
Summary: PaginatorPage should subclass listpaginator Page should subclass list

comment:2 by Chris Beaven, 15 years ago

Summary: paginator Page should subclass listpaginator Page should be iterable
Triage Stage: UnreviewedDesign decision needed

Hrm... maybe it shouldn't subclass list since object_list might not actually be a list...

It should have __len__, __contains__ and __iter__ at least then.

by Chris Beaven, 14 years ago

Attachment: 11596.2.diff added

by Chris Beaven, 14 years ago

Attachment: 11596.3.diff added

with docs

comment:3 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:4 by Julien Phalip, 14 years ago

Patch needs improvement: set
Triage Stage: Design decision neededAccepted

I like this idea. However, it seems like collections.Sequence was introduced in Python 2.6, causing this patch to fail when run on Python 2.5.

comment:5 by Chris Beaven, 14 years ago

Resolution: fixed
Status: assignedclosed

In [16018]:

Fixes #11596 -- Make paginator.Page iterable

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