Tuesday, June 22, 2021

Django Admin - Advanced configuration

Each model has a list of individual records, identified by the string created with the model's __str__() method, and linked to detail views/forms for editing. By default, this view has an action menu at the top that you can use to perform bulk delete operations on records.


You can further customise the interface to make it even easier to use. Some of the things you can do are:


List views:

Add additional fields/information displayed for each record. 

Add filters to select which records are listed, based on date or some other selection value (e.g. Book loan status).

Add additional options to the actions menu in list views and choose where this menu is displayed on the form.


Detail views

Choose which fields to display (or exclude), along with their order, grouping, whether they are editable, the widget used, orientation etc.

Add related fields to a record to allow inline editing (e.g. add the ability to add and edit book records while you're creating their author record).

references:

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Admin_site

No comments:

Post a Comment