First commit of claude's rework in django + vanillajs fronted
This commit is contained in:
36
apps/sessions/admin.py
Normal file
36
apps/sessions/admin.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import FreePracticeSession, PRSSession, PRSStage, SpeedShootingSession
|
||||
|
||||
|
||||
class PRSStageInline(admin.TabularInline):
|
||||
model = PRSStage
|
||||
extra = 0
|
||||
fields = [
|
||||
'order', 'position', 'distance_m',
|
||||
'target_width_cm', 'target_height_cm', 'max_time_s', 'shots_count',
|
||||
'actual_elevation', 'actual_windage',
|
||||
'hits', 'score', 'time_taken_s',
|
||||
]
|
||||
|
||||
|
||||
@admin.register(PRSSession)
|
||||
class PRSSessionAdmin(admin.ModelAdmin):
|
||||
list_display = ['__str__', 'user', 'date', 'location', 'competition_name', 'category']
|
||||
list_filter = ['date']
|
||||
search_fields = ['user__email', 'competition_name', 'location']
|
||||
inlines = [PRSStageInline]
|
||||
|
||||
|
||||
@admin.register(FreePracticeSession)
|
||||
class FreePracticeSessionAdmin(admin.ModelAdmin):
|
||||
list_display = ['__str__', 'user', 'date', 'location', 'distance_m', 'rounds_fired']
|
||||
list_filter = ['date']
|
||||
search_fields = ['user__email', 'name', 'location']
|
||||
|
||||
|
||||
@admin.register(SpeedShootingSession)
|
||||
class SpeedShootingSessionAdmin(admin.ModelAdmin):
|
||||
list_display = ['__str__', 'user', 'date', 'format', 'rounds_fired']
|
||||
list_filter = ['date']
|
||||
search_fields = ['user__email', 'name', 'format']
|
||||
Reference in New Issue
Block a user