def create_slot(record, tp): if 'tutorial' in record.type: slotkind = SlotKind.objects.filter(label="tutorials").first() else: slotkind = SlotKind.objects.filter(label="talks").first() room = Room.objects.filter(name=record.room).first() if not room: raise Room.DoesNotExist("No room called {}".format(record.room)) section = Section.objects.filter(slug="talks").first() start = dt(record.start_time) end = dt(record.end_time) day = Day.objects.filter(date=start.date()).first() # Make the slot s = Slot(name=record.slot[:100], day=day, kind=slotkind, start=start, end=end) s.save() # Assign room to slot sr = SlotRoom(slot=s, room=room) sr.save() # Create presentation p = Presentation( slot=s, title=tp.title, description=tp.description, abstract=tp.abstract, speaker=list(tp.speakers())[0], proposal_base_id=tp.id, section=section, ) p.save() return p
def promote_proposal(proposal): if hasattr(proposal, "presentation") and proposal.presentation: # already promoted presentation = proposal.presentation else: presentation = Presentation( title=proposal.title, description=proposal.description, abstract=proposal.abstract, speaker=proposal.speaker, section=proposal.section, proposal_base=proposal, ) presentation.save() for speaker in proposal.additional_speakers.all(): presentation.additional_speakers.add(speaker) presentation.save() return presentation
def promote_proposal(proposal): if hasattr(proposal, "presentation") and proposal.presentation: # already promoted presentation = proposal.presentation else: presentation = Presentation( title = proposal.title, description = proposal.description, abstract = proposal.abstract, speaker = proposal.speaker, section = proposal.section, proposal_base = proposal, ) presentation.save() for speaker in proposal.additional_speakers.all(): presentation.additional_speakers.add(speaker) presentation.save() return presentation