cmsmanage/rentals/admin.py

15 lines
352 B
Python
Raw Normal View History

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)