<commit_before>from django.contrib import admin

from know_me import models


class AppleSubscriptionInline(admin.StackedInline):
    """
    Inline admin editor for Apple subscription data.
    """

    fields = (
        "receipt_data",
        "receipt_data_hash",
        "expiration_time",
        "time_created",
        "time_updated",
    )
    model = models.SubscriptionAppleData
    readonly_fields = (
        "expiration_time",
        "receipt_data_hash",
        "time_created",
        "time_updated",
    )


@admin.register(models.Subscription)
class SubscriptionAdmin(admin.ModelAdmin):
    """
    Admin for Know Me subscriptions.
    """<commit_msg>Add admin for Know Me users.<commit_after>from django.contrib import admin

from know_me import models


class AppleSubscriptionInline(admin.StackedInline):
    """
    Inline admin editor for Apple subscription data.
    """

    fields = (
        "receipt_data",
        "receipt_data_hash",
        "expiration_time",
        "time_created",
        "time_updated",
    )
    model = models.SubscriptionAppleData
    readonly_fields = (
        "expiration_time",
        "receipt_data_hash",
        "time_created",
        "time_updated",
    )


@admin.register(models.KMUser)
class KMUserAdmin(admin.ModelAdmin):
    """
    Admin for Know Me users.
    """

    autocomplete_fields = ("user",)
    date_hierarchy = "created_at"
    fields = (
        "user",
        "image",
        "is_legacy_user",
        "quote",
        "created_at",
        "updated_at",
    )
    list_display = ("user", "is_legacy_user", "created_at", "updated_at")
    list_filter = ("is_legacy_user",)
    readonly_fields = ("created_at", "updated_at")
    search_fields = ("user__first_name", "user__last_name")


@admin.register(models.Subscription)
class SubscriptionAdmin(admin.ModelAdmin):
    """
    Admin for Know Me subscriptions.
    """
{'fraction_non_alphanumeric': 0.11286089238845144, 'fraction_numerical': 0.0, 'mean_word_length': 2.774257425742574, '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': '1515271', 'n_tokens_mistral': 587, 'n_tokens_neox': 578, 'n_words': 113}