List rooms in slot admin

In many parts of the schedule there are multiple slots with the same
start/end times, and it can be hard to find the one you want to edit.

Make this slightly simpler by listing the room names in the admin list.
This commit is contained in:
James Polley 2017-12-24 13:52:51 +11:00
parent cabad1c7d5
commit 193ffc76d5

View file

@ -27,10 +27,14 @@ class SlotRoomInline(admin.TabularInline):
class SlotAdmin(admin.ModelAdmin):
list_filter = ("day", "kind","exclusive")
list_display = ("day", "start", "end", "kind", "content_override","exclusive")
list_display = ("day", "start", "end", "kind", "room_names",
"content_override","exclusive")
list_editable = ("exclusive",)
inlines = [SlotRoomInline]
def room_names(self, slot):
return ", ".join(room.name for room in slot.rooms.all())
class RoomAdmin(admin.ModelAdmin):
list_display = ["name", "order", "schedule"]