Opened 13 years ago

Closed 10 years ago

#16432 closed New feature (wontfix)

MultipleObjectMixin should handle pagination prior to get_context_data

Reported by: AndrewIngram Owned by: Asif Saifuddin Auvi
Component: Generic views Version: dev
Severity: Normal Keywords:
Cc: AndrewIngram Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The current implementation of MultipleObjectMixin performs all its pagination operations as part of get_context_data. Some views might require knowledge of pagination earlier in the process, for example a ModelFormSetView I've implemented needs to know about the pagination at the point it instantiates the FormSet, which happens before get_context_data is called.

At the moment we set self.object_list to the result of self.get_queryset(), I am wondering whether self.object_list should actually be the paginated result, and we can store the unpaginated queryset (unevaluated because we won't usually need it) as self.original_object_list (or something nicer) which would also be available in the context data.

I'm concerned that any changes to accomodate this requirement might affect the API of MultipleObjectMixin in a backwards-incompatible way, so I'd like to get feedback from the core devs as to what the right way to tackle this is.

Change History (7)

comment:1 by Aymeric Augustin, 13 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by AndrewIngram, 13 years ago

Cc: AndrewIngram added

comment:3 by Jacob, 13 years ago

Resolution: wontfix
Status: newclosed

I can't see how this could be done in a backwards-compatible way, so I'm going to mark this wontfix. However, if I'm wrong -- entirely possible, I often am! -- please feel free to reopen. A patch would be nice, even an incomplete one -- it's hard to picture this stuff without a bit of code.

Thanks!

comment:4 by Asif Saifuddin Auvi, 10 years ago

Resolution: wontfix
Status: closednew
Version: 1.3master

comment:5 by Asif Saifuddin Auvi, 10 years ago

Owner: changed from nobody to Asif Saifuddin Auvi
Status: newassigned

comment:6 by Baptiste Mispelon, 10 years ago

Hi,

Could you explain the reasoning behind you reopening this ticket? In particular, can you address Jacob's concerns of backwards compatibility?

Thanks.

comment:7 by Baptiste Mispelon, 10 years ago

Resolution: wontfix
Status: assignedclosed

Re-closing per previous comment.

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