<commit_before>from django.contrib import admin
from models import Term, Context, Flashcard, Category


class TermAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name', 'type')
    search_fields = ('name', 'type')


class ContextAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name')
    search_fields = ('name', )


class FlashcardAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'term', 'context')


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name', 'type')
    search_fields = ('name', 'type')


admin.site.register(Term, TermAdmin)
admin.site.register(Context, ContextAdmin)
admin.site.register(Flashcard, FlashcardAdmin)
admin.site.register(Category, CategoryAdmin)<commit_msg>Fix proso_flashcards category admin performance<commit_after>from django.contrib import admin
from models import Term, Context, Flashcard, Category


class TermAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name', 'type')
    search_fields = ('name', 'type')


class ContextAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name')
    search_fields = ('name', )


class FlashcardAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'term', 'context')


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('id', 'identifier', 'lang', 'name', 'type')
    search_fields = ('name', 'type')
    raw_id_fields = ('terms', 'subcategories', 'flashcards', 'contexts')


admin.site.register(Term, TermAdmin)
admin.site.register(Context, ContextAdmin)
admin.site.register(Flashcard, FlashcardAdmin)
admin.site.register(Category, CategoryAdmin)
{'fraction_non_alphanumeric': 0.15995329830706362, 'fraction_numerical': 0.0, 'mean_word_length': 5.939271255060729, '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': '7117703', 'n_tokens_mistral': 519, 'n_tokens_neox': 504, 'n_words': 124}