from django.contrib import admin
from .models import *


@admin.register(UserToken)
class DevEventAdmin(admin.ModelAdmin):
    readonly_fields = ['access_token']
    list_display = ['user', 'creation_time', 'small_access_token']
    fields = ['user', 'creation_time', 'access_token']
    ordering = ['-creation_time']

    def small_access_token(self, obj):
        return f"{obj.access_token[:8]}..."
