<commit_before>"""ModelAdmin configurations for comments app."""

from __future__ import absolute_import
from django.contrib import admin
from .models import DocumentNode, DocumentComment, NodeSnapshot


class SnapshotAdmin(admin.TabularInline):
    model = NodeSnapshot


class DocumentNodeAdmin(admin.ModelAdmin):
    search_fields = ('id', 'document')
    list_filter = ('project__name',)
    raw_id_fields = ('project', 'version')
    list_display = ('__unicode__', 'latest_hash', 'latest_commit')
    inlines = (SnapshotAdmin,)


class DocumentCommentAdmin(admin.ModelAdmin):
    search_fields = ('text',)
    raw_id_fields = ('node',)

admin.site.register(DocumentNode, DocumentNodeAdmin)
admin.site.register(DocumentComment, DocumentCommentAdmin)<commit_msg>Fix runtime error on python 3 (#3072)<commit_after>"""ModelAdmin configurations for comments app."""

from __future__ import absolute_import
from django.contrib import admin
from .models import DocumentNode, DocumentComment, NodeSnapshot


class SnapshotAdmin(admin.TabularInline):
    model = NodeSnapshot


class DocumentNodeAdmin(admin.ModelAdmin):
    search_fields = ('id', 'document')
    list_filter = ('project__name',)
    raw_id_fields = ('project', 'version')
    list_display = ('latest_hash', 'latest_commit')
    inlines = (SnapshotAdmin,)


class DocumentCommentAdmin(admin.ModelAdmin):
    search_fields = ('text',)
    raw_id_fields = ('node',)

admin.site.register(DocumentNode, DocumentNodeAdmin)
admin.site.register(DocumentComment, DocumentCommentAdmin)
{'fraction_non_alphanumeric': 0.11176088369070825, 'fraction_numerical': 0.003248862897985705, 'mean_word_length': 6.064220183486238, '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': '7032683', 'n_tokens_mistral': 434, 'n_tokens_neox': 420, 'n_words': 102}