#8408: add a new meta option: don't do count(*) in admin -----------------------------------------+------------------------------- Reporter: lidaobing | Owner: nobody Type: Uncategorized | Status: reopened Milestone: | Component: contrib.admin Version: SVN | Severity: Normal Resolution: | Keywords: Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 -----------------------------------------+------------------------------- Changes (by boxm):
* status: closed => reopened * severity: => Normal * cc: boxm@… (added) * type: => Uncategorized * version: 0.96 => SVN * easy: => 0 * resolution: wontfix => Comment: Replying to [comment:17 lrekucki]: > Replying to [comment:16 kmike]: > > I think this can be marked as 'wontfix' because custom paginators can be used in admin now: > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.paginator > > Agreed :) Here's a link to a sample [http://code.google.com/p/django- pagination/source/browse/trunk/pagination/paginator.py?r=47 Paginator that doesn't use count] Reopening, as the resolution simply doesn't work. The example paginator given by kmike simply doesn't work as a ModelAdmin paginator, because the {% pagination %} tag and the ChangeList class (among others) assume you can count the number of items being paginated. See my comment on #4065 for the gory details. There are scenarios where you don't know how many results are being paginated, but can still do useful pagination links: - With InnoDB tables in MySQL, count(*) is frighteningly expensive, so while in principle you can count, in practice you can't - With NoSQL databases it can be impossible to do a count, but you can still paginate by range queries A proposed design for such a paginator would be to display (on page 12): 1 2 3 ..... 10 11 '''12''' ... Next which is better than just next/prev. I'll see if I can create acceptable patches. -- Ticket URL: <https://code.djangoproject.com/ticket/8408#comment:18> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.