Complete the code to register a model with a custom admin class.
from django.contrib import admin from .models import Book class BookAdmin(admin.ModelAdmin): pass admin.site.[1](Book, BookAdmin)
Use admin.site.register to register a model with the admin site.
Complete the code to display the 'title' and 'author' fields in the admin list view.
class BookAdmin(admin.ModelAdmin): list_display = ([1])
The list_display attribute expects a tuple of field names as strings.
Fix the error in the code to enable search by 'title' in the admin.
class BookAdmin(admin.ModelAdmin): search_fields = [1]
The search_fields attribute must be a list or tuple of strings.
Fill both blanks to filter the admin list by 'published_date' and order by 'title'.
class BookAdmin(admin.ModelAdmin): list_filter = ([1],) ordering = ([2],)
list_filter is for filtering by fields like dates, and ordering sets the default order.
Fill all three blanks to customize the admin: show 'title' and 'author', enable search on 'title', and filter by 'status'.
class BookAdmin(admin.ModelAdmin): list_display = ([1], [2]) search_fields = [[3]] list_filter = ('status',)
Use list_display to show fields, search_fields as a list for searching, and list_filter for filtering.