<commit_before>
from django.contrib import admin
from timeside.server.models import *


class PresetAdmin(admin.ModelAdmin):
    model = Preset
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'processor', 'parameters', 'date_added', 'date_modified']
    list_filter = ['date_modified', 'processor']
    search_fields = ['uuid', 'processor__name']


class ProcessorAdmin(admin.ModelAdmin):
    model = Processor
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'pid']
    search_fields = ['uuid', 'name']


class SelectionAdmin(admin.ModelAdmin):
    model = Selection
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified']
    filter_horizontal = ['items', 'selections']
    search_fields = ['title', 'uuid']


class ExperienceAdmin(admin.ModelAdmin):
    model = Experience
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified', 'title']
    filter_horizontal = ['presets', 'experiences']
    search_fields = ['uuid', 'title']


class TaskAdmin(admin.ModelAdmin):
    model = Task
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified', 'status']
    list_filter = ['date_modified', 'status']
    search_fields = ['uuid']


class ResultAdmin(admin.ModelAdmin):
    model = Result
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'run_time', 'mime_type', 'status', 'date_added', 'date_modified', 'uuid']
    list_filter = ['date_modified', 'status', 'item', 'preset']
    search_fields = ['uuid']


class AnalysisAdmin(admin.ModelAdmin):
    model = Analysis
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified', 'render_type']
    list_filter = ['date_modified', 'uuid']


class AnalysisTrackAdmin(admin.ModelAdmin):
    model = AnalysisTrack
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified']
    search_fields = ['uuid', 'title']


class ProviderAdmin(admin.ModelAdmin):
    model = Provider
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid']
    search_fields = ['uuid', 'name']
    
class ItemAdmin(admin.ModelAdmin):
    model = Item
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    search_fields = ['uuid', 'title']

admin.site.register(Selection, SelectionAdmin)
admin.site.register(Item, ItemAdmin)
admin.site.register(Experience, ExperienceAdmin)
admin.site.register(Processor, ProcessorAdmin)
admin.site.register(SubProcessor)

admin.site.register(Preset, PresetAdmin)
admin.site.register(Result, ResultAdmin)
admin.site.register(Task, TaskAdmin)
admin.site.register(Analysis, AnalysisAdmin)
admin.site.register(AnalysisTrack, AnalysisTrackAdmin)
admin.site.register(Annotation)
admin.site.register(AnnotationTrack)

admin.site.register(Provider, ProviderAdmin)<commit_msg>admin: cleanup search fields, add item.author search field<commit_after>
from django.contrib import admin
from timeside.server.models import *


class PresetAdmin(admin.ModelAdmin):
    model = Preset
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'processor', 'parameters', 'date_added', 'date_modified']
    list_filter = ['date_modified', 'processor']
    search_fields = ['uuid', 'processor__name']


class ProcessorAdmin(admin.ModelAdmin):
    model = Processor
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'pid']
    search_fields = ['uuid', 'name']


class SelectionAdmin(admin.ModelAdmin):
    model = Selection
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified']
    filter_horizontal = ['items', 'selections']
    search_fields = ['title', 'uuid']


class ExperienceAdmin(admin.ModelAdmin):
    model = Experience
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified',]
    filter_horizontal = ['presets', 'experiences']
    search_fields = ['uuid', 'title']


class TaskAdmin(admin.ModelAdmin):
    model = Task
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified', 'status']
    list_filter = ['date_modified', 'status']
    search_fields = ['uuid']


class ResultAdmin(admin.ModelAdmin):
    model = Result
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'run_time', 'mime_type', 'status', 'date_added', 'date_modified', 'uuid']
    list_filter = ['date_modified', 'status',]
    search_fields = ['uuid', 'item', 'preset']


class AnalysisAdmin(admin.ModelAdmin):
    model = Analysis
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified', 'render_type']
    search_fields = ['uuid',]
    list_filter = ['date_modified',]


class AnalysisTrackAdmin(admin.ModelAdmin):
    model = AnalysisTrack
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    list_filter = ['date_modified']
    search_fields = ['uuid', 'title']


class ProviderAdmin(admin.ModelAdmin):
    model = Provider
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid']
    search_fields = ['uuid', 'name']


class ItemAdmin(admin.ModelAdmin):
    model = Item
    readonly_fields = ('uuid',)
    list_display = ['__str__', 'uuid', 'date_added', 'date_modified']
    search_fields = ['uuid', 'title']
    list_filter = ['author',]


admin.site.register(Selection, SelectionAdmin)
admin.site.register(Item, ItemAdmin)
admin.site.register(Experience, ExperienceAdmin)
admin.site.register(Processor, ProcessorAdmin)
admin.site.register(SubProcessor)

admin.site.register(Preset, PresetAdmin)
admin.site.register(Result, ResultAdmin)
admin.site.register(Task, TaskAdmin)
admin.site.register(Analysis, AnalysisAdmin)
admin.site.register(AnalysisTrack, AnalysisTrackAdmin)
admin.site.register(Annotation)
admin.site.register(AnnotationTrack)

admin.site.register(Provider, ProviderAdmin)
{'fraction_non_alphanumeric': 0.15265948899244738, 'fraction_numerical': 0.0, 'mean_word_length': 5.084066471163245, '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': '2233084', 'n_tokens_mistral': 1916, 'n_tokens_neox': 1886, 'n_words': 402}