I need turn off django admin pagination. I use mttp in django and I need disable pagination on some admin module.
How I can do it?
Or how I can make pagination only by parents?
I need turn off django admin pagination. I use mttp in django and I need disable pagination on some admin module.
How I can do it?
Or how I can make pagination only by parents?
The number of items per page is determined by ModelAdmin.list_per_page
.
As @codingjoe's comment suggests, setting this to sys.maxsize
is very likely to suffice.
import sys
class PartAdmin(admin.ModelAdmin):
list_per_page = sys.maxsize
If you're using Django 1.8 (the newest version), there is a new setting on the ModelAdmin class called show_full_result_count
that I believe will do what you're looking for. You can set it to false and it will disable the pagination on the Django admin view.
I do this in order to put everything on one page:
class PartAdmin(admin.ModelAdmin):
list_per_page = Part.objects.all().count()
list_max_show_all = list_per_page
It just counts all the parts (my model is called "Part") and then makes that the max number per page.