X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/5c901ee485c3abdf11dec71bdb7534f1f6a9eaa9..f8fbc227da604d9d4d96f011b22fd6786dac1a10:/src/ssh_keys/admin.py?ds=sidebyside diff --git a/src/ssh_keys/admin.py b/src/ssh_keys/admin.py index b907416..6e75313 100644 --- a/src/ssh_keys/admin.py +++ b/src/ssh_keys/admin.py @@ -1,5 +1,12 @@ from django.contrib import admin +from django.db.models import F from .models import SSHKey -admin.site.register(SSHKey) +class SSHKeyAdmin(admin.ModelAdmin): + fields = ['user', 'key', 'algorithm', 'bit_length', 'md5_hash', 'created_at', 'last_seen_at'] + readonly_fields = ['algorithm', 'bit_length', 'md5_hash', 'created_at', 'last_seen_at'] + list_display = ['comment', 'last_seen_at', 'user', 'md5_hash', 'algorithm', 'bit_length', 'created_at'] + ordering = (F('last_seen_at').desc(nulls_last=True),) + +admin.site.register(SSHKey, SSHKeyAdmin)