from django.contrib import admin

from moods.models import Mood, MoodReason
from scrobbles.admin import ScrobbleInline


class MoodInline(admin.TabularInline):
    model = Mood
    extra = 0


@admin.register(Mood)
class MoodAdmin(admin.ModelAdmin):
    date_hierarchy = "created"
    list_display = (
        "uuid",
        "title",
        "mood_type",
    )
    ordering = ("-created",)
    search_fields = ("title",)
    inlines = [
        ScrobbleInline,
    ]


@admin.register(MoodReason)
class MoodReasonAdmin(admin.ModelAdmin):
    list_display = ("title", "uuid")
    search_fields = ("title",)
