generated from bisco/codex-bootstrap
31 lines
889 B
Python
31 lines
889 B
Python
from django.contrib import admin
|
|
|
|
from .models import CheckIn
|
|
|
|
|
|
@admin.register(CheckIn)
|
|
class CheckInAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"reservation",
|
|
"performance",
|
|
"checked_in_at",
|
|
"checked_in_by",
|
|
"source",
|
|
"created_at",
|
|
)
|
|
list_filter = ("source", "checked_in_at", "created_at")
|
|
search_fields = (
|
|
"reservation__name",
|
|
"reservation__email",
|
|
"reservation__performance__show__title",
|
|
"checked_in_by__username",
|
|
"checked_in_by__email",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at", "checked_in_at")
|
|
list_select_related = ("reservation", "reservation__performance", "checked_in_by")
|
|
autocomplete_fields = ("reservation", "checked_in_by")
|
|
|
|
@admin.display(description="Performance")
|
|
def performance(self, obj):
|
|
return obj.reservation.performance
|