Login

Increase maximum number of changelist items for "Show all" link to appear

Author:
ramen
Posted:
November 18, 2009
Language:
Python
Version:
1.1
Score:
0 (after 0 ratings)

By default, a "Show all" link will appear in the changelist pager only if fewer than 200 records are in the result. Since it is rare that there will be more than one page of records yet fewer than 200, the "Show all" link almost never shows up. Pasting this code somewhere in your app will allow you to increase the 200-record maximum.

"Show all" is very handy when used in combination with batch actions and filters, and this change will enable it for most situations. Note that this allows a changelist with up to 10,000 results, which results in a lot of HTML that can tax slower browsers and older machines. For me, it has been worth the tradeoff, since my users have fast enough computers and need to be able to make batch changes efficiently.

1
2
3
# Increase maximum number of changelist items for "Show all" link to appear.
from django.contrib.admin.views import main as admin_views_main
admin_views_main.MAX_SHOW_ALL_ALLOWED = 10000

More like this

  1. Month / Year SelectDateWidget based on django SelectDateWidget by pierreben 3 weeks, 1 day ago
  2. Python Django CRUD Example Tutorial by tuts_station 1 month, 1 week ago
  3. Browser-native date input field by kytta 2 months, 3 weeks ago
  4. Generate and render HTML Table by LLyaudet 3 months ago
  5. My firs Snippets by GutemaG 3 months ago

Comments

Please login first before commenting.