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
|
2014-05-24 23:15:14 +02:00
|
|
|
readonly_fields = ['passwd']
|
|
|
|
can_delete = False
|
2014-05-24 21:53:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
class UserAdmin(admin.ModelAdmin):
|
|
|
|
inlines = [AdditionalGroupInline, ShadowInline]
|
2014-05-24 23:15:14 +02:00
|
|
|
readonly_fields = ['uid']
|
2014-05-24 21:53:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(Group)
|
|
|
|
admin.site.register(User, UserAdmin)
|