Re: Pagination in ListView

2012-01-04 Thread J. Cliff Dyer
I've certainly seen blogs where I wished I could paginate negatively, where -1 would be the last page, -2 the second to last and so on. I was trying to work my way through a blog's archives from the beginning, but they kept adding new posts, so I never knew if the page I left off on was the page I'

Re: Pagination in ListView

2012-01-04 Thread Tom Evans
On Wed, Jan 4, 2012 at 12:09 PM, Matt Stevens wrote: > I've found a solution, but I don't like it. The canonical solution is included in the docs: https://docs.djangoproject.com/en/1.3/topics/pagination/#using-paginator-in-a-view Briefly: paginator = Paginator(objects, 50, orphans=10) #

Re: Pagination in ListView

2012-01-04 Thread Matt Stevens
I've found a solution, but I don't like it. This will show the last page, but - it doesn't do a redirect. === class MyListView(ListView):     model = models.Post     template_name = 'post_list.html'     paginate_by = 10         def paginate_queryset(

Pagination in ListView

2012-01-04 Thread Matt Stevens
Hi, I'm using a list view to show a list of my objects. === class MyListView(ListView): model = models.Post template_name = 'post_list.html' paginate_by = 10 === When a visitors goes to a p