cmsmanage/rentals/admin.py

18 lines
355 B
Python
Raw Normal View History

from django.contrib import admin
from .models import LockerBank, LockerRental
2022-01-24 23:37:04 -05:00
class LockerRentalInline(admin.TabularInline):
model = LockerRental
extra = 0
2022-01-24 23:37:04 -05:00
@admin.register(LockerBank)
class LockerBankAdmin(admin.ModelAdmin):
inlines = [LockerRentalInline]
prepopulated_fields = {"slug": ("name",)}
2022-01-24 23:37:04 -05:00
admin.site.register(LockerRental)