Changes between Initial Version and Version 2 of Ticket #28917


Ignore:
Timestamp:
Dec 18, 2017, 9:04:52 PM (7 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28917

    • Property Owner changed from nobody to Junji Wei
    • Property Status newassigned
    • Property Component Generic viewsCore (Other)
    • Property Triage Stage UnreviewedAccepted
    • Property Summary Paginator shows ordering warning on an empty .none() querysetRemove paginator's unordered queryset warning for a .none() queryset
    • Property Type BugCleanup/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.
    22
    3 However, if also emits this warning if passed a queryset which is guaranteed to be empty, for instance Article.objects.none()
     3However, if also emits this warning if passed a queryset which is guaranteed to be empty, for instance `Article.objects.none()`.
    44
    5 Working around this warning involves doing a bizarre Article.objects.none().order_by('id')
     5Working around this warning involves doing a bizarre `Article.objects.none().order_by('id')`
    66
    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.
     7I 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.
Back to Top