Does pagination has to load all objects before showing the pages?

2012-10-17 Thread Bastian
I need to paginate a list of images that is getting bigger and bigger and is loading slowly. I tried the simple django-pagination module but even the first page takes as long as the whole list to load. I was wondering where to look but then thought maybe this pagination app only takes the whole

Re: Does pagination has to load all objects before showing the pages?

2012-10-17 Thread Bill Freeman
Look for somewhere that you're evaluating the queryset. Pagination doesn't need to evaluate it, since it can slice it, which turns into a start and a limit on the database side. Beware of using len() on a queryset (evaluates, IIRC), use qs.count() instead (done on the DB). On Wed, Oct 17, 2012 a