views:

75

answers:

2

In one of the models overview panel, after I filter the items by month, I have to select them all and then create a document with information regarding them (kind of like a monthly report). This is a problem when one month has more than 100 items as Django paginates the filtering results.

Is there a way to increase the number of items shown from 100 to 400 or select all the items from the filtering result?

Selecting all the items from one page, creating a document, going to the next, creating another, etc, then merging the documents isn't an option.

+1  A: 

See http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_per_page

In your ModelAdmin definition, set list_per_page:

class MyModelAdmin(admin.ModelAdmin):
    list_per_page = 400

I believe you can also add the all GET parameter to your query (ie, add ?all to the end of your url), but that only works if you have less than 200 items, and this limit is hardcoded in the admin. Therefore it's only useful if you have more than list_per_page (100) and less than 200 items, but the admin will offer you a link for this anyway when this is the case.

Will Hardy
A: 

If you're talking about admin, see this.

ModelAdmin.list_per_page
Dmitry Shevchenko