About Lesson
Customizing Model Display in Admin
The ModelAdmin
class allows you to customize how the model is displayed in the admin panel.
- list_display: Define which fields to display in the list view.
- list_filter: Add filters in the sidebar to filter the displayed list of objects.
- search_fields: Enable a search bar to search for specific fields.
- ordering: Set the default ordering of records.
Customizing Form Display in Admin
- fields: Specify the order of fields in the form view.
- exclude: Exclude certain fields from the form view.