generated from bisco/codex-bootstrap
feat: improve admin and add demo data command
This commit is contained in:
@@ -5,7 +5,14 @@ from .models import CheckIn
|
||||
|
||||
@admin.register(CheckIn)
|
||||
class CheckInAdmin(admin.ModelAdmin):
|
||||
list_display = ("reservation", "checked_in_at", "checked_in_by", "source", "created_at")
|
||||
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",
|
||||
@@ -14,4 +21,10 @@ class CheckInAdmin(admin.ModelAdmin):
|
||||
"checked_in_by__username",
|
||||
"checked_in_by__email",
|
||||
)
|
||||
readonly_fields = ("created_at", "updated_at")
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user