Changes between Initial Version and Version 2 of Ticket #28917
- Timestamp:
- Dec 18, 2017, 9:04:52 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28917
- Property Owner changed from to
- Property Status new → assigned
- Property Component Generic views → Core (Other)
- Property Triage Stage Unreviewed → Accepted
- Property Summary Paginator shows ordering warning on an empty .none() queryset → Remove paginator's unordered queryset warning for a .none() queryset
- Property Type Bug → Cleanup/optimization
-
Ticket #28917 – Description
initial v2 1 Paginator (sanely!) does a check to verify that the queryset it is passed is ordered, and if it isn't, shows a warning.1 `Paginator` shows a warning if it receives an unordered queryset. 2 2 3 However, if also emits this warning if passed a queryset which is guaranteed to be empty, for instance Article.objects.none()3 However, if also emits this warning if passed a queryset which is guaranteed to be empty, for instance `Article.objects.none()`. 4 4 5 Working around this warning involves doing a bizarre Article.objects.none().order_by('id')5 Working around this warning involves doing a bizarre `Article.objects.none().order_by('id')` 6 6 7 I believe there can be legitimate usecases for passing a .none()queryset to a paginator, for instance if a user's permissions are such that we restrict the objects they can view to the empty queryset.7 I believe there can be legitimate usecases for passing a `.none()` queryset to a paginator, for instance if a user's permissions are such that we restrict the objects they can view to the empty queryset.