experiENS/monstage/admin.py

26 lines
686 B
Python
Raw Normal View History

from django.contrib import admin
2015-05-26 00:27:22 +02:00
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from monstage.models import *
2015-05-26 00:27:22 +02:00
class NormalienInline(admin.StackedInline):
model = Normalien
inline_classes = ("collapse open",)
class UserAdmin(UserAdmin):
inlines = (NormalienInline, )
class LieuStageInline(admin.StackedInline):
model = LieuStage
inline_classes = ("collapse open",)
extra = 0
class StageAdmin(admin.ModelAdmin):
inlines = (LieuStageInline, )
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
admin.site.register(Lieu)
admin.site.register(StageMatiere)
admin.site.register(Stage, StageAdmin)