#22810: full_result_count optimization is wrong in the presence of custom
ListFilters
-------------------------------+--------------------
     Reporter:  gwahl@…        |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  contrib.admin  |    Version:  1.6
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 ChangeList.get_results performs an optimization when counting the total
 number of results, disregarding list filters. It assumes that if there are
 no query parameters, the full count is the same as the filtered count.
 This is incorrect when a custom list filter does filtering when there are
 no query parameters.

 In my case, the list filter filters the objects by default, and removes
 the filtering with a query parameter. The optimization incorrectly assumes
 that there is no filtering by default, so the total result count is wrong.

 
https://github.com/django/django/blob/master/django/contrib/admin/views/main.py#L172,
 see 'Perform a slight optimization'.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22810>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.498e76b3a9106ba57eccbe25616cabb3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to