Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django admin pagination question

hi i got a model in django admin working fine but it is listing all the object in only one page i would like to paginate then .. What do i need to add at my admin.py to get then paginate ... ?

heres my admin.py :

from cliente.models import Cliente
from django.contrib import admin

class ClienteAdmin(admin.ModelAdmin):
    list_display = ('nome','bairro','endereco','telefone')
    list_filter = ('bairro',)
    ordering = ('nome',)
    search_fields = ('endereco',)   
    pass

admin.site.register(Cliente,ClienteAdmin)   
like image 591
user614778 Avatar asked Feb 13 '11 23:02

user614778


1 Answers

See ModelAdmin.list_per_page. The default is 100, but you can set it to a lower value.

like image 167
Arnaud Avatar answered Nov 03 '22 00:11

Arnaud