generated from bisco/codex-bootstrap
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
from django.contrib import admin
|
|
|
|
from .models import Performance, Show, Venue
|
|
|
|
|
|
@admin.register(Show)
|
|
class ShowAdmin(admin.ModelAdmin):
|
|
list_display = ("title", "slug", "is_published", "created_at", "updated_at")
|
|
list_filter = ("is_published",)
|
|
search_fields = ("title", "slug", "summary", "description")
|
|
prepopulated_fields = {"slug": ("title",)}
|
|
|
|
|
|
@admin.register(Venue)
|
|
class VenueAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "slug", "city", "address", "created_at", "updated_at")
|
|
list_filter = ("city",)
|
|
search_fields = ("name", "slug", "address", "city", "notes")
|
|
prepopulated_fields = {"slug": ("name",)}
|
|
|
|
|
|
@admin.register(Performance)
|
|
class PerformanceAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"show",
|
|
"venue",
|
|
"starts_at",
|
|
"room_capacity",
|
|
"additional_seats",
|
|
"manually_occupied_seats",
|
|
"is_booking_enabled",
|
|
)
|
|
list_filter = ("is_booking_enabled", "starts_at", "show", "venue")
|
|
search_fields = ("show__title", "venue__name", "venue__city")
|