django-cas-server/cas_server/admin.py

43 lines
1.3 KiB
Python
Raw Normal View History

2015-05-16 21:43:46 +00:00
from django.contrib import admin
from models import *
from forms import *
# Register your models here.
class ServiceTicketInline(admin.TabularInline):
model = ServiceTicket
extra = 0
form = TicketForm
class ProxyTicketInline(admin.TabularInline):
model = ProxyTicket
extra = 0
form = TicketForm
class ProxyGrantingInline(admin.TabularInline):
model = ProxyGrantingTicket
extra = 0
form = TicketForm
class UserAdmin(admin.ModelAdmin):
inlines = (ServiceTicketInline, ProxyTicketInline, ProxyGrantingInline)
2015-05-18 18:30:00 +00:00
class UsernamesInline(admin.TabularInline):
model = Usernames
extra = 0
class ReplaceAttributNameInline(admin.TabularInline):
model = ReplaceAttributName
extra = 0
class ReplaceAttributValueInline(admin.TabularInline):
model = ReplaceAttributValue
extra = 0
class FilterAttributValueInline(admin.TabularInline):
model = FilterAttributValue
extra = 0
2015-05-16 21:43:46 +00:00
class ServicePatternAdmin(admin.ModelAdmin):
2015-05-18 18:30:00 +00:00
inlines = (UsernamesInline, ReplaceAttributNameInline, ReplaceAttributValueInline, FilterAttributValueInline)
list_display = ('pos', 'name', 'pattern', 'proxy')
2015-05-16 21:43:46 +00:00
admin.site.register(User, UserAdmin)
admin.site.register(ServicePattern, ServicePatternAdmin)
#admin.site.register(ProxyGrantingTicketIOU, admin.ModelAdmin)