from django.contrib import admin from .models import ( AdditionalGroup, Group, Shadow, User, ) class AdditionalGroupInline(admin.TabularInline): model = AdditionalGroup class ShadowInline(admin.TabularInline): model = Shadow readonly_fields = ['passwd'] can_delete = False class UserAdmin(admin.ModelAdmin): inlines = [AdditionalGroupInline, ShadowInline] readonly_fields = ['uid'] admin.site.register(Group) admin.site.register(User, UserAdmin)