<commit_before># Django
from django.contrib import admin

# Local
from .models import Appearance
from .models import Assignment
from .models import Award
from .models import Competitor
from .models import Contest
from .models import Contestant
from .models import Convention
from .models import Entry
from .models import Grantor
from .models import Grid
from .models import Group
from .models import Member
from .models import Officer
from .models import Panelist
from .models import Repertory
from .models import Round
from .models import Score
from .models import Session
from .models import Song


class ActiveChapterInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'code',
        # 'kind',
        'gender',
        # 'bhs_id',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Chapters'

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.chapter,
        )
        return qs


class ActiveChorusInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'bhs_id',
        # 'code',
        # 'kind',
        'gender',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Choruses'
    readonly_fields = [
        'status',
    ]

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.chorus,
        )
        return qs


class ActiveQuartetInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'bhs_id',
        'is_senior',
        'gender',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Quartets'
    readonly_fields = [
        'status',
    ]

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.quartet,
        )
        return qs


class AppearanceInline(admin.TabularInline):
    model = Appearance
    fields = [
        'competitor',
        'legacy_group',
        'status',
        'num',
        'draw',
        'tot_points',
    ]
    readonly_fields = [
        'competitor',
        'status',
    ]
    ordering = (
        'num',
    )
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]


class AssignmentInline(admin.TabularInline):
    model = Assignment
    fields = [
        'status',
        'category',
        'kind',
        'person',
        'convention',
    ]
    readonly_fields = [
        'status',
    ]
    autocomplete_fields = [
        'person',
        'convention',
    ]
    ordering = (
        'category',
        'kind',
        'person__last_name',
        'person__first_name',
    )
    extra = 0
    show_change_link = True
    classes = [
        'collapse',
    ]


class AwardInline(admin.TabularInline):
    model = Award
    fields = [
        'name',
        'kind',
        'gender',
        'rounds',
        'size',
        'is_improved',
        'group',
    ]
    readonly_fields = [
        'name',
        'status',
    ]
    extra = 0<commit_msg>Fix award inline<commit_after># Django
from django.contrib import admin

# Local
from .models import Appearance
from .models import Assignment
from .models import Award
from .models import Competitor
from .models import Contest
from .models import Contestant
from .models import Convention
from .models import Entry
from .models import Grantor
from .models import Grid
from .models import Group
from .models import Member
from .models import Officer
from .models import Panelist
from .models import Repertory
from .models import Round
from .models import Score
from .models import Session
from .models import Song


class ActiveChapterInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'code',
        # 'kind',
        'gender',
        # 'bhs_id',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Chapters'

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.chapter,
        )
        return qs


class ActiveChorusInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'bhs_id',
        # 'code',
        # 'kind',
        'gender',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Choruses'
    readonly_fields = [
        'status',
    ]

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.chorus,
        )
        return qs


class ActiveQuartetInline(admin.TabularInline):
    model = Group
    fields = [
        'name',
        'parent',
        'bhs_id',
        'is_senior',
        'gender',
        # 'status',
    ]
    fk_name = 'parent'
    ordering = [
    ]
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]
    verbose_name_plural = 'Active Quartets'
    readonly_fields = [
        'status',
    ]

    def get_queryset(self, request):
        """Alter the queryset to return no existing entries."""
        qs = super().get_queryset(request)
        qs = qs.filter(
            status__gt=0,
            kind=Group.KIND.quartet,
        )
        return qs


class AppearanceInline(admin.TabularInline):
    model = Appearance
    fields = [
        'competitor',
        'legacy_group',
        'status',
        'num',
        'draw',
        'tot_points',
    ]
    readonly_fields = [
        'competitor',
        'status',
    ]
    ordering = (
        'num',
    )
    show_change_link = True
    extra = 0
    classes = [
        'collapse',
    ]


class AssignmentInline(admin.TabularInline):
    model = Assignment
    fields = [
        'status',
        'category',
        'kind',
        'person',
        'convention',
    ]
    readonly_fields = [
        'status',
    ]
    autocomplete_fields = [
        'person',
        'convention',
    ]
    ordering = (
        'category',
        'kind',
        'person__last_name',
        'person__first_name',
    )
    extra = 0
    show_change_link = True
    classes = [
        'collapse',
    ]


class AwardInline(admin.TabularInline):
    model = Award
    fields = [
        'name',
        'kind',
        'gender',
        'rounds',
        'group',
    ]
    readonly_fields = [
        'name',
        'status',
    ]
    extra = 0
{'fraction_non_alphanumeric': 0.10656167979002625, 'fraction_numerical': 0.002362204724409449, 'mean_word_length': 1.796697247706422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3673516', 'n_tokens_mistral': 2343, 'n_tokens_neox': 2321, 'n_words': 559}