Inconsistant handling of context_object_name in paginated MultipleObjectMixin
|Reported by:||Dave Hall||Owned by:||Dave Hall|
|Cc:||Dave Hall||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
Without pagination, the MultipleObjectMixin uses a context_object_name based on the name of the model being displayed, such as page_list.
However, when you use pagination by specifying paginate_by, the context_object_name becomes the less-than-helpful object_list.
The fix is simple:
Basically, the paginator overwrites the queryset with a simple Python list. This patch prevents that.
Change History (12)
comment:3 Changed 5 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|