<commit_before>from django.contrib import admin

from us_ignite.challenges.models import Challenge, Entry, EntryAnswer, Question


class QuestionInlineAdmin(admin.TabularInline):
    model = Question
    extra = 5


class ChallengeAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug', 'status', 'start_datetime', 'end_datetime')
    search_fields = ('name', 'slug', 'summary', 'description')
    list_filter = ('status', 'start_datetime', 'end_datetime')
    date_hierarchy = 'start_datetime'
    inlines = [QuestionInlineAdmin]


class EntryAnswerAdminInstance(admin.TabularInline):
    extra = 0
    model = EntryAnswer


class EntryAdmin(admin.ModelAdmin):
    list_display = ('challenge', 'application', 'status', 'created', 'modified')
    list_filter = ('challenge__name', 'status')
    date_hierarchy = 'created'
    raw_id_fields = ('application', )
    inlines = [EntryAnswerAdminInstance, ]


admin.site.register(Challenge, ChallengeAdmin)
admin.site.register(Entry, EntryAdmin)
<commit_msg>Filter for external run ``Challenges``.<commit_after>from django.contrib import admin

from us_ignite.challenges.models import Challenge, Entry, EntryAnswer, Question


class QuestionInlineAdmin(admin.TabularInline):
    model = Question
    extra = 5


class ChallengeAdmin(admin.ModelAdmin):
    list_display = (
        'name', 'slug', 'status', 'is_external',
        'start_datetime', 'end_datetime')
    search_fields = ('name', 'slug', 'summary', 'description')
    list_filter = ('status', 'is_external', 'start_datetime', 'end_datetime')
    date_hierarchy = 'start_datetime'
    inlines = [QuestionInlineAdmin]


class EntryAnswerAdminInstance(admin.TabularInline):
    extra = 0
    model = EntryAnswer


class EntryAdmin(admin.ModelAdmin):
    list_display = ('challenge', 'application', 'status', 'created', 'modified')
    list_filter = ('challenge__name', 'status')
    date_hierarchy = 'created'
    raw_id_fields = ('application', )
    inlines = [EntryAnswerAdminInstance, ]


admin.site.register(Challenge, ChallengeAdmin)
admin.site.register(Entry, EntryAdmin)

{'fraction_non_alphanumeric': 0.12494016275730015, 'fraction_numerical': 0.0019147917663954045, 'mean_word_length': 5.093294460641399, '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': '3602371', 'n_tokens_mistral': 636, 'n_tokens_neox': 610, 'n_words': 136}