mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 06:31:13 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
33
django-backend/apps/timeline/admin.py
Normal file
33
django-backend/apps/timeline/admin.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
from .models import EntityTimelineEvent
|
||||
|
||||
|
||||
@admin.register(EntityTimelineEvent)
|
||||
class EntityTimelineEventAdmin(ModelAdmin):
|
||||
list_display = ['title', 'entity_type', 'entity_id', 'event_type', 'event_date', 'is_public', 'created_by']
|
||||
list_filter = ['entity_type', 'event_type', 'is_public', 'event_date', 'event_date_precision']
|
||||
search_fields = ['title', 'description', 'entity_id']
|
||||
date_hierarchy = 'event_date'
|
||||
ordering = ['-event_date', '-created_at']
|
||||
readonly_fields = ['created_at', 'updated_at']
|
||||
|
||||
fieldsets = (
|
||||
('Event Information', {
|
||||
'fields': ('title', 'description', 'event_type', 'event_date', 'event_date_precision')
|
||||
}),
|
||||
('Entity Reference', {
|
||||
'fields': ('entity_type', 'entity_id')
|
||||
}),
|
||||
('Event Details', {
|
||||
'fields': ('from_entity_id', 'to_entity_id', 'from_location', 'to_location', 'from_value', 'to_value'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
('Visibility & Order', {
|
||||
'fields': ('is_public', 'display_order')
|
||||
}),
|
||||
('Tracking', {
|
||||
'fields': ('created_by', 'approved_by', 'submission', 'created_at', 'updated_at'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
)
|
||||
Reference in New Issue
Block a user