joashivanmoodley / django-pagination

Automatically exported from code.google.com/p/django-pagination
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Using Paginator is harmful for querysets #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I think usage of django.core.paginator.Paginator is improper in
pagination_tags.py

Paginator class uses len(object) for counting number of objects in
queryset. So, queries like Article.objects.all() in view, will run very slooow.

I changed the Line 67 of pagination_tags.py to use QuerySetPaginator, and
result is as expected.

Original issue reported on code.google.com by mdsi...@gmail.com on 12 Oct 2008 at 7:58

GoogleCodeExporter commented 8 years ago
Attached patch.

Original comment by mdsi...@gmail.com on 12 Oct 2008 at 8:11

Attachments:

GoogleCodeExporter commented 8 years ago
My bad. looks like it's already fixed in django 1.0

I am still living in the old world.

Original comment by mdsi...@gmail.com on 12 Oct 2008 at 8:21

GoogleCodeExporter commented 8 years ago

Original comment by flo...@gmail.com on 20 Oct 2008 at 12:52