from django.contrib import admin

from cineart.movies.models import Movie
from cineart.subtitles.models import Subtitle


class SubtitleInline(admin.StackedInline):
    model = Subtitle
    extra = 0


@admin.register(Movie)
class MovieAdmin(admin.ModelAdmin):
    list_display = ["title", "created_at"]
    list_display_links = ["title", "created_at"]
    search_fields = ["title", "created_at"]
    list_per_page = 20
    inlines = [SubtitleInline]

{'avg_line_length': 23.736842105263158, 'max_line_length': 48, 'alphanum_fraction': 0.7317073170731707, 'licenses': ['MIT'], 'repository_name': 'orutrax/cineart', 'path': 'cineart/movies/admin.py', 'size': 451, 'lang': 'Python'}