CRUD names the four routine operations performed on data: create, read, update, and delete. In Django Admin, registering a model automatically provides pages for these operations. section 5.1.3
A Django Admin model typically exposes:
- Listing and Change pages for reading objects and updating their fields. section 5.1.3
- Add and Delete pages for creating and removing objects. section 5.1.3
- A registered ModelAdmin class connected to the application’s model. section 5.1.3
Registering a Musician model
Define MusicianAdmin as a subclass of admin.ModelAdmin and register it with Musician. Even an empty class body provides the default CRUD pages. section 5.1.3
Listing 5.1 The MusicianAdmin class
# RiffMates/bands/admin.py
from django.contrib import admin
from bands.models import Musician #1
@admin.register(Musician) #2
class MusicianAdmin(admin.ModelAdmin): #3
pass #4
Inspect the compact MusicianAdmin registration pattern, including the model import, decorator, subclass, and empty body. section 5.1.3










