<commit_before>from django.contrib import admin

from rhino import models


class AccountAdmin(admin.ModelAdmin):
    list_display = ('display_name', 'service', 'ident')

admin.site.register(models.Account, AccountAdmin)


class ObjectAdmin(admin.ModelAdmin):
    list_display = ('title', 'author', 'render_mode', 'external_id')

    def external_id(self, obj):
        if obj.service and obj.foreign_id:
            return u'%s:%s' % (obj.service, obj.foreign_id)
        if obj.foreign_id:
            return obj.foreign_id
        return None

admin.site.register(models.Object, ObjectAdmin)


class UserStreamAdmin(admin.ModelAdmin):
    list_display = ('obj', 'user', 'time')
    readonly_fields = ('time',)

admin.site.register(models.UserStream, UserStreamAdmin)


class UserReplyStreamAdmin(admin.ModelAdmin):
    list_display = ('reply', 'root', 'user', 'reply_time')

admin.site.register(models.UserReplyStream, UserReplyStreamAdmin)


admin.site.register(models.Person)
admin.site.register(models.Media)<commit_msg>Provide incompletely useful filter for Person records<commit_after>from django.contrib import admin

from rhino import models


class AccountAdmin(admin.ModelAdmin):
    list_display = ('display_name', 'service', 'ident')

admin.site.register(models.Account, AccountAdmin)


class ObjectAdmin(admin.ModelAdmin):
    list_display = ('title', 'author', 'render_mode', 'external_id')

    def external_id(self, obj):
        if obj.service and obj.foreign_id:
            return u'%s:%s' % (obj.service, obj.foreign_id)
        if obj.foreign_id:
            return obj.foreign_id
        return None

admin.site.register(models.Object, ObjectAdmin)


class UserStreamAdmin(admin.ModelAdmin):
    list_display = ('obj', 'user', 'time')
    readonly_fields = ('time',)

admin.site.register(models.UserStream, UserStreamAdmin)


class UserReplyStreamAdmin(admin.ModelAdmin):
    list_display = ('reply', 'root', 'user', 'reply_time')

admin.site.register(models.UserReplyStream, UserReplyStreamAdmin)


class PersonAdmin(admin.ModelAdmin):
    list_filter = ('user',)

admin.site.register(models.Person, PersonAdmin)


admin.site.register(models.Media)
{'fraction_non_alphanumeric': 0.12563276576161989, 'fraction_numerical': 0.0, 'mean_word_length': 4.560102301790281, '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': '2043095', 'n_tokens_mistral': 673, 'n_tokens_neox': 648, 'n_words': 136}