[charts] Big revamp of the charts app
All checks were successful
build & deploy / test (push) Successful in 1m53s
build & deploy / deploy (push) Successful in 24s

This commit is contained in:
2026-03-21 18:13:34 -04:00
parent 565adfe58e
commit d5d27256f8
31 changed files with 2006 additions and 1100 deletions

View File

@ -0,0 +1,50 @@
from charts.models import ChartRecord
from django.contrib import admin
@admin.register(ChartRecord)
class ChartRecordAdmin(admin.ModelAdmin):
date_hierarchy = "created"
list_display = (
"user",
"rank",
"count",
"year",
"month",
"week",
"day",
"media_name",
"media_type",
)
list_filter = (
"user",
"year",
"month",
"week",
"day",
"tv_series",
"podcast",
"board_game",
"book",
"food",
"trail",
)
ordering = ("-created",)
search_fields = (
"artist__name",
"album__name",
"track__title",
"tv_series__name",
"video__title",
"podcast__name",
"board_game__name",
"book__title",
"food__name",
"trail__name",
)
def media_name(self, obj):
return obj.media_obj
def media_type(self, obj):
return obj.media_type