<commit_before>from django.contrib import admin
from scifight import models

admin.AdminSite.site_header = 'SciFight'


@admin.register(models.Team)
class TeamAdmin(admin.ModelAdmin):
    pass


@admin.register(models.Problem)
class ProblemAdmin(admin.ModelAdmin):
    pass


@admin.register(models.Fight)
class FightAdmin(admin.ModelAdmin):
    pass


@admin.register(models.FightStage)
class AdminFightStage(admin.ModelAdmin):
    pass


@admin.register(models.TeamOrigin)
class AdminTeamOrigin(admin.ModelAdmin):
    pass


@admin.register(models.Participant)
class AdminTeamOrigin(admin.ModelAdmin):
    pass

<commit_msg>scifight/admin.py: enable inline team participant edition<commit_after>from django.contrib import admin
from django         import forms
from scifight import models

admin.AdminSite.site_header = 'SciFight'


class ParticipantForm(forms.ModelForm):

    class Meta:
        model = models.Participant
        exclude = []
        widgets = {
            # FIXME: Magic constant!
            'grade': forms.TextInput(attrs={'size': 5}),
        }


class ParticipantInline(admin.TabularInline):
    model = models.Participant
    form  = ParticipantForm
    extra = 0


class LeaderInline(admin.TabularInline):
    model = models.Leader
    extra = 0


@admin.register(models.Team)
class TeamAdmin(admin.ModelAdmin):
    inlines = [LeaderInline, ParticipantInline]


@admin.register(models.Problem)
class ProblemAdmin(admin.ModelAdmin):
    pass


@admin.register(models.Fight)
class FightAdmin(admin.ModelAdmin):
    pass


@admin.register(models.FightStage)
class AdminFightStage(admin.ModelAdmin):
    pass


@admin.register(models.TeamOrigin)
class AdminTeamOrigin(admin.ModelAdmin):
    pass


@admin.register(models.Participant)
class AdminTeamOrigin(admin.ModelAdmin):
    pass


{'fraction_non_alphanumeric': 0.097736057426836, 'fraction_numerical': 0.0016565433462175593, 'mean_word_length': 4.236994219653179, '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': '2177651', 'n_tokens_mistral': 563, 'n_tokens_neox': 543, 'n_words': 107}