List Info

Thread: Are paginators lazy?




Are paginators lazy?
user name
2007-12-18 07:26:05
I am using the paginators(django.core.paginator) as
describes at
http://www.djangoproject.com/documentation/models/p
agination/ .
Are paginators lazy, like .filter and related method are? If
I use
paginator = ObjectPaginator(Article.objects.all(), 5)
and then paginator.get_page(0)
would the first 5 pages be loaded or all of the objects
returned
by .all be loaded?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Are paginators lazy?
user name
2007-12-18 08:35:08
Paginator is lazy. It loads only needed page. It uses slice
syntax( [:] ) of query set

On 18 ΔΕΛ, 16:26, shabda <shabda.r...gmail.com> wrote:
> I am using the paginators(django.core.paginator) as
describes athttp://www.djangoproject.com/documentation/models/
pagination/.
> Are paginators lazy, like .filter and related method
are? If I use
> paginator = ObjectPaginator(Article.objects.all(), 5)
> and then paginator.get_page(0)
> would the first 5 pages be loaded or all of the objects
returned
> by .all be loaded?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )