generated from bisco/codex-bootstrap
feat: add initial Django domain models
This commit is contained in:
34
backend/shows/admin.py
Normal file
34
backend/shows/admin.py
Normal file
@@ -0,0 +1,34 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user