sebastian
sebastian

Reputation: 73

Custom object listing in Django admin

I'm new at Django and I'm creating a small app that has some really simple models but uses custom users. Now I wish to customize the object listing in the administration for some users. What I wish to do is customize the object listing in myserver/admin/myapp/myobject but I haven't found which should I extend to do so. I'd be thank to know where should I look.

Upvotes: 1

Views: 1452

Answers (1)

Kevin Cherepski
Kevin Cherepski

Reputation: 1483

I would take a thorough look through the Django admin documentation. They do a pretty good job at explaining how to customize the list display.

https://docs.djangoproject.com/en/dev/ref/contrib/admin/

I would focus on learning the following, https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display This will alter the fields being shown for each row in the list.

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter This will allow you to filter your data which is shown within the list.

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields This will allow you to add a search box which will let you search against the objects within the list.

Upvotes: 1

Related Questions