title: Using object_list generic view for pagination in Django
link: http://jj.isgeek.net/2009/01/using-object_list-generic-view-for-pagination-in-django/
author: Jj
description: 
post_id: 519
date: 2009/01/07 18:44:45
created_gmt: 2009/01/07 23:44:45
comment_status: open
slug: using-object_list-generic-view-for-pagination-in-django

Whenever I want to display a list of items I'll need pagination, calculate first page, next page, total pages, current page, previous page, etc.

Although Django comes with pretty [good pagination helpers](http://docs.djangoproject.com/en/dev/topics/pagination/#topics-pagination), I've found that using the `list_detail.object_list` generic view hanles this very nicely :) 

So whenever I want to display a list, I will return an object_list generic view instead of a HttpResponse object or a render_to_response call.

This came in pretty handy when helping [Jason Broyles](http://jasonism.org/about/) [refactor some pagination code](http://jasonism.org/weblog/2008/dec/19/advanced-searches-pagination-using-django/)

## Comments

**[CursBnr](#357574 "2010-12-11 06:30:37"):** Hello; Charming post to me. Your send has good quality.

