mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 15:31:08 -05:00
20 lines
747 B
Python
20 lines
747 B
Python
from django.contrib import admin
|
|
from simple_history.admin import SimpleHistoryAdmin
|
|
from .models import Park, ParkArea
|
|
|
|
@admin.register(Park)
|
|
class ParkAdmin(SimpleHistoryAdmin):
|
|
list_display = ('name', 'location', 'owner', 'status', 'opening_date')
|
|
list_filter = ('status', 'owner')
|
|
search_fields = ('name', 'location', 'description')
|
|
prepopulated_fields = {'slug': ('name',)}
|
|
readonly_fields = ('id', 'created_at', 'updated_at')
|
|
|
|
@admin.register(ParkArea)
|
|
class ParkAreaAdmin(SimpleHistoryAdmin):
|
|
list_display = ('name', 'park', 'opening_date')
|
|
list_filter = ('park',)
|
|
search_fields = ('name', 'description')
|
|
prepopulated_fields = {'slug': ('name',)}
|
|
readonly_fields = ('id', 'created_at', 'updated_at')
|