Code

Opened 5 years ago

Closed 3 years ago

#11596 closed New feature (fixed)

paginator Page should be iterable

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

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 SmileyChris 5 years ago.
11596.2.diff (2.0 KB) - added by SmileyChris 3 years ago.
11596.3.diff (3.4 KB) - added by SmileyChris 3 years ago.
with docs

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by SmileyChris

comment:1 Changed 5 years ago by SmileyChris

  • Keywords paginate added
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to SmileyChris
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Summary changed from PaginatorPage should subclass list to paginator Page should subclass list

comment:2 Changed 5 years ago by SmileyChris

  • Summary changed from paginator Page should subclass list to paginator Page should be iterable
  • Triage Stage changed from Unreviewed to Design 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.

Changed 3 years ago by SmileyChris

Changed 3 years ago by SmileyChris

with docs

comment:3 Changed 3 years ago by julien

  • Severity set to Normal
  • Type set to New feature

comment:4 Changed 3 years ago by julien

  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

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 Changed 3 years ago by SmileyChris

  • Resolution set to fixed
  • Status changed from assigned to closed

In [16018]:

Fixes #11596 -- Make paginator.Page iterable

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.