from django.contrib import admin

from .models import DeckVariant, TarotCard


@admin.register(DeckVariant)
class DeckVariantAdmin(admin.ModelAdmin):
    list_display = ["name", "slug", "card_count", "is_default"]
    prepopulated_fields = {"slug": ["name"]}


@admin.register(TarotCard)
class TarotCardAdmin(admin.ModelAdmin):
    list_display = ["name", "deck_variant", "arcana", "suit", "number", "group", "slug"]
    list_filter = ["deck_variant", "arcana", "suit"]
    search_fields = ["name", "slug", "correspondence", "group"]
    readonly_fields = ["slug", "correspondence", "group"]
    ordering = ["deck_variant", "arcana", "suit", "number"]
