evorepo/devel/admin.py
Dan McGee d21d8be018 UserProfile model and fields shuffle
Move this model into the devel/ application, and move the PGPKeyField
which is used only by these models into the application as well. This
involves updating some old migrations along the way to ensure we don't
reference a field class that no longer exists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20 11:15:03 -05:00

38 lines
1.1 KiB
Python

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from .models import UserProfile, MasterKey, PGPSignature
class UserProfileInline(admin.StackedInline):
model = UserProfile
class UserProfileAdmin(UserAdmin):
inlines = [UserProfileInline]
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'is_active')
list_filter = ('is_staff', 'is_superuser', 'is_active')
class MasterKeyAdmin(admin.ModelAdmin):
list_display = ('pgp_key', 'owner', 'created', 'revoker', 'revoked')
search_fields = ('pgp_key', 'owner', 'revoker')
date_hierarchy = 'created'
class PGPSignatureAdmin(admin.ModelAdmin):
list_display = ('signer', 'signee', 'created', 'expires', 'valid')
list_filter = ('valid',)
search_fields = ('signer', 'signee')
date_hierarchy = 'created'
admin.site.unregister(User)
admin.site.register(User, UserProfileAdmin)
admin.site.register(MasterKey, MasterKeyAdmin)
admin.site.register(PGPSignature, PGPSignatureAdmin)
# vim: set ts=4 sw=4 et: