You can paginate whatever you want. From the docs: "Note that you can give Paginator a list/tuple, a Django QuerySet, or any other object with a count() or __len__() method. "
On Dec 19, 3:33 am, Continuation <selforgani...@gmail.com> wrote: > In the django-pagination, it uses the example: > {% autopaginate object_list %} > > My question is does object_list have to be the **entire** list over > which I want to paginate, or can I limit the length of object_list? If > I limit the length of object_list, will autopaginate still go through > the entire list? > > As an example, say I want to paginate over the list a.field_set.all(). > Let's say that list has 10000 objects. I might not want my database to > return such a large result set. So I might want to do something like: > > object_list = a.field_set()[:5] > > Now if I use {% autopaginate object_list %} in my template, would I > still be able to paginate over the entire list of 10000 objects? Or my > list would be shortened to 5 objects? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.