symposion_app/symposion/schedule/admin.py
Hiroshi Miura 32e8c27df9 admin: inline edit day and slotroom
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2015-08-01 13:03:55 +09:00

45 lines
1 KiB
Python

from django.contrib import admin
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole
class DayInline(admin.StackedInline):
model = Day
extra = 2
class SlotKindInline(admin.StackedInline):
model = SlotKind
class ScheduleAdmin(admin.ModelAdmin):
model = Schedule
inlines = [DayInline, SlotKindInline, ]
class SlotRoomInline(admin.TabularInline):
model = SlotRoom
extra = 1
class SlotAdmin(admin.ModelAdmin):
list_filter = ("day", "kind")
list_display = ("day", "start", "end", "kind", "content")
inlines = [SlotRoomInline, ]
class RoomAdmin(admin.ModelAdmin):
inlines = [SlotRoomInline, ]
class PresentationAdmin(admin.ModelAdmin):
model = Presentation
list_filter = ("section", "cancelled", "slot")
admin.site.register(Schedule, ScheduleAdmin)
admin.site.register(Room, RoomAdmin)
admin.site.register(Slot, SlotAdmin)
admin.site.register(Session)
admin.site.register(SessionRole)
admin.site.register(Presentation, PresentationAdmin)