first stab at making a room slot, still not quite there, think i have to make a separate slot for each time slot

This commit is contained in:
Clinton Roy 2019-10-13 15:52:51 +11:00 committed by Joel Addison
parent 92adbb3314
commit 8badb0cb99

View file

@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand
from symposion.conference.models import Section, current_conference from symposion.conference.models import Section, current_conference
from symposion.schedule.models import (Day, Presentation, Room, SlotKind, Schedule, Slot) from symposion.schedule.models import (Day, Presentation, Room, SlotKind, Schedule, Slot, SlotRoom)
from symposion.proposals.models import ProposalBase from symposion.proposals.models import ProposalBase
@ -109,6 +109,7 @@ class Command(BaseCommand):
for room_name in room_names: for room_name in room_names:
room, _created = Room.objects.get_or_create( room, _created = Room.objects.get_or_create(
schedule=schedule, name=room_name, order=used_rooms.index(room_name)) schedule=schedule, name=room_name, order=used_rooms.index(room_name))
rooms[room_name] = room
slotkinds = {} slotkinds = {}
for slotkind_name in slotkind_names: for slotkind_name in slotkind_names:
@ -141,6 +142,8 @@ class Command(BaseCommand):
slot = slots[(date, kind_name, start_time, end_time)] slot = slots[(date, kind_name, start_time, end_time)]
slotroom = SlotRoom.objects.get_or_create(slot=slot, room=rooms[room])
proposal = ProposalBase.objects.filter(pk=talk_id).first() proposal = ProposalBase.objects.filter(pk=talk_id).first()
assert proposal, f"Could not find proposal {talk_id}" assert proposal, f"Could not find proposal {talk_id}"