<commit_before>from django.contrib import admin

from karspexet.show.models import Production, Show


@admin.register(Production)
class ProductionAdmin(admin.ModelAdmin):
    list_display = ("name", "alt_name")


@admin.register(Show)
class ShowAdmin(admin.ModelAdmin):
    list_display = ("production", "slug", "date_string")
    list_filter = ("production",)
    exclude = ("slug",)
    ordering = ("-pk",)<commit_msg>Improve ShowAdmin to give better overview<commit_after>from django.contrib import admin
from django.utils import timezone

from karspexet.show.models import Production, Show


@admin.register(Production)
class ProductionAdmin(admin.ModelAdmin):
    list_display = ("name", "alt_name")


@admin.register(Show)
class ShowAdmin(admin.ModelAdmin):
    list_display = ("date_string", "production", "venue", "visible", "is_upcoming")
    list_select_related = ("production", "venue")
    list_filter = ("visible", "production")
    exclude = ("slug",)
    ordering = ("-pk",)

    @admin.display(boolean=True)
    def is_upcoming(self, obj):
        return obj.date > timezone.now()
{'fraction_non_alphanumeric': 0.1395985401459854, 'fraction_numerical': 0.0, 'mean_word_length': 5.094444444444444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '202349', 'n_tokens_mistral': 336, 'n_tokens_neox': 327, 'n_words': 77}