<commit_before>"""Django admin interface for `~builds.models.Build` and related models.

"""

from django.contrib import admin
from readthedocs.builds.models import Build, VersionAlias, Version, BuildCommandResult
from guardian.admin import GuardedModelAdmin


class BuildCommandResultInline(admin.TabularInline):
    model = BuildCommandResult
    fields = ('command', 'exit_code')


class BuildAdmin(admin.ModelAdmin):
    fields = ('project', 'version', 'type', 'state', 'success', 'length')
    list_display = ('project', 'success', 'type', 'state')
    raw_id_fields = ('project', 'version')
    inlines = (BuildCommandResultInline,)


class VersionAdmin(GuardedModelAdmin):
    search_fields = ('slug', 'project__name')
    list_filter = ('project', 'privacy_level')


admin.site.register(Build, BuildAdmin)
admin.site.register(VersionAlias)
admin.site.register(Version, VersionAdmin)<commit_msg>Add date back to build display<commit_after>"""Django admin interface for `~builds.models.Build` and related models.

"""

from django.contrib import admin
from readthedocs.builds.models import Build, VersionAlias, Version, BuildCommandResult
from guardian.admin import GuardedModelAdmin


class BuildCommandResultInline(admin.TabularInline):
    model = BuildCommandResult
    fields = ('command', 'exit_code')


class BuildAdmin(admin.ModelAdmin):
    fields = ('project', 'version', 'type', 'state', 'success', 'length')
    list_display = ('project', 'success', 'type', 'state', 'date')
    raw_id_fields = ('project', 'version')
    inlines = (BuildCommandResultInline,)


class VersionAdmin(GuardedModelAdmin):
    search_fields = ('slug', 'project__name')
    list_filter = ('project', 'privacy_level')


admin.site.register(Build, BuildAdmin)
admin.site.register(VersionAlias)
admin.site.register(Version, VersionAdmin)
{'fraction_non_alphanumeric': 0.13067249863313285, 'fraction_numerical': 0.0, 'mean_word_length': 6.011494252873563, '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': '4909663', 'n_tokens_mistral': 531, 'n_tokens_neox': 523, 'n_words': 129}