Changeset - f70345ba8a2a
[Not reviewed]
0 0 1
Clinton Roy - 5 years ago 2019-10-19 01:38:29
clintonr@ansto.gov.au
dummy presentations to play with
1 file changed with 46 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pinaxcon/registrasion/management/commands/dummy_presentations.py
Show inline comments
 
new file 100644
 
from django.core.management.base import BaseCommand
 

	
 
from symposion.conference.models import Section, current_conference, Conference
 

	
 

	
 
from symposion.speakers.models import Speaker
 
from symposion.schedule.models import Day, Schedule, Session
 

	
 
from symposion.schedule.models import (Day, Presentation, Room, SlotKind, Slot,
 
                                       SlotRoom, ProposalBase)
 

	
 
from dateutil.parser import parse
 

	
 
from pinaxcon.proposals.models import TalkProposal
 

	
 
from symposion.proposals.models import ProposalSection, ProposalKind
 

	
 
from collections import  Counter
 
from pathlib import Path
 
import csv
 

	
 

	
 
class Command(BaseCommand):
 
    known_headers = ["date", "start time", "end time", "kind", "rooms"]
 
    SLOTS = 'slots'
 
    TALKS = 'talks'
 

	
 
    help = "Creates a bunch of dummy presentations to play around with."
 

	
 
    def handle(self, *args, **options):
 
        conf = current_conference()
 
        section = Section.objects.filter(conference=conf, slug="main").all().first()
 
        speaker = Speaker.objects.first()
 
        talk_kind = ProposalKind.objects.first()
 
        target_audience = TalkProposal.TARGET_USER
 

	
 
        print(talk_kind)
 

	
 
        for i in range(1000, 1010):
 
            prop, _created = TalkProposal.objects.get_or_create(
 
                pk=i, kind=talk_kind, speaker=speaker, target_audience=target_audience)
 
            pres, _created = Presentation.objects.get_or_create(
 
                proposal_base=prop, section=section, speaker=speaker,
 
                title=f"dummy title {i}", abstract=f"dummy abstract {i}")
 

	
 

	
0 comments (0 inline, 0 general)