from django.contrib import admin from .models import LockerBank, LockerRental class LockerRentalInline(admin.TabularInline): model = LockerRental extra = 0 @admin.register(LockerBank) class LockerBankAdmin(admin.ModelAdmin): inlines = [LockerRentalInline] prepopulated_fields = {"slug": ("name",)} admin.site.register(LockerRental)