admin: inline edit day and slotroom
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
parent
55814a57b3
commit
32e8c27df9
1 changed files with 38 additions and 13 deletions
|
@ -3,18 +3,43 @@ from django.contrib import admin
|
||||||
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole
|
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Schedule)
|
class DayInline(admin.StackedInline):
|
||||||
admin.site.register(Day)
|
model = Day
|
||||||
admin.site.register(Room)
|
extra = 2
|
||||||
admin.site.register(SlotKind)
|
|
||||||
admin.site.register(
|
|
||||||
Slot,
|
class SlotKindInline(admin.StackedInline):
|
||||||
list_display=("day", "start", "end", "kind")
|
model = SlotKind
|
||||||
)
|
|
||||||
admin.site.register(
|
|
||||||
SlotRoom,
|
class ScheduleAdmin(admin.ModelAdmin):
|
||||||
list_display=("slot", "room")
|
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(Session)
|
||||||
admin.site.register(SessionRole)
|
admin.site.register(SessionRole)
|
||||||
admin.site.register(Presentation)
|
admin.site.register(Presentation, PresentationAdmin)
|
||||||
|
|
Loading…
Reference in a new issue