gva/gnuviechadmin/osusers/admin.py

28 lines
495 B
Python
Raw Normal View History

2014-05-24 21:28:33 +02:00
from django.contrib import admin
2014-05-24 21:53:49 +02:00
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
2014-05-24 21:53:49 +02:00
class UserAdmin(admin.ModelAdmin):
inlines = [AdditionalGroupInline, ShadowInline]
readonly_fields = ['uid']
2014-05-24 21:53:49 +02:00
admin.site.register(Group)
admin.site.register(User, UserAdmin)