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