def setup_labour(self): from core.models import Event, Person from core.utils import slugify from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, Survey, ) from ...models import SignupExtra, Night, Poison from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2019, 9, 6, 8, 0, tzinfo=self.tz), work_ends=datetime(2019, 9, 8, 22, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Traconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) self.afterparty_perk, unused = Perk.objects.get_or_create( event=self.event, slug='kaatajaiset', defaults=dict(name='Kaatajaiset', ), ) fmh = PersonnelClass.objects.filter(event=self.event, slug='ylivankari') if fmh.exists(): fmh.update(name='Vuorovastaava', slug='vuorovastaava') for pc_name, pc_slug, pc_app_label, pc_afterparty in [ ('Coniitti', 'coniitti', 'labour', True), ('Duniitti', 'duniitti', 'labour', True), ('Vuorovastaava', 'vuorovastaava', 'labour', True), ('Työvoima', 'tyovoima', 'labour', True), ('Ohjelma', 'ohjelma', 'programme', True), ('Ohjelma 2. luokka', 'ohjelma-2lk', 'programme', False), ('Ohjelma 3. luokka', 'ohjelma-3lk', 'programme', False), ('Guest of Honour', 'goh', 'programme', False), # tervetullut muttei kutsuta automaattiviestillä ('Media', 'media', 'badges', False), ('Myyjä', 'myyja', 'badges', False), ('Vieras', 'vieras', 'badges', False), ('Vapaalippu, viikonloppu', 'vapaalippu-vkl', 'tickets', False), ('Vapaalippu, lauantai', 'vapaalippu-la', 'tickets', False), ('Vapaalippu, sunnuntai', 'vapaalippu-su', 'tickets', False), ('Cosplaykisaaja', 'cosplay', 'tickets', False), ('Taidekuja', 'taidekuja', 'tickets', False), ('Yhdistyspöydät', 'yhdistyspoydat', 'tickets', False), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if pc_afterparty and created: personnel_class.perks.set([self.afterparty_perk]) personnel_class.save() # v33 PersonnelClass.objects.filter( event=self.event, slug='coniitti', icon_css_class='fa-user', ).update(icon_css_class='fa-check-square') PersonnelClass.objects.filter( event=self.event, slug='duniitti', icon_css_class='fa-user', ).update(icon_css_class='fa-check-square-o') tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') coniitti = PersonnelClass.objects.get(event=self.event, slug='coniitti') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='tracon2018'), target_event=self.event, ) for name in ['Conitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path= 'events.tracon2019.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.tracon2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 9, 26, 12, 32, 0, tzinfo=self.tz), active_until=datetime(2019, 9, 8, 23, 59, 59, tzinfo=self.tz), ), ) for wiki_space, link_title, link_group in [ ('TERA', 'Työvoimawiki', 'accepted'), ('INFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url= 'https://atlasso.tracon.fi/crowd?next=https://confluence.tracon.fi/display/{wiki_space}' .format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ))
def setup_labour(self): from core.models import Person, Event from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, Survey, ) from ...models import SignupExtra, SpecialDiet, Night from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2017, 9, 8, 8, 0, tzinfo=self.tz), work_ends=datetime(2017, 9, 10, 22, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Traconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) self.afterparty_perk, unused = Perk.objects.get_or_create( event=self.event, slug='kaatajaiset', defaults=dict( name='Kaatajaiset', ), ) fmh = PersonnelClass.objects.filter(event=self.event, slug='ylivankari') if fmh.exists(): fmh.update(name='Vuorovastaava', slug='vuorovastaava') for pc_name, pc_slug, pc_app_label, pc_afterparty in [ ('Coniitti', 'coniitti', 'labour', True), ('Duniitti', 'duniitti', 'labour', True), ('Vuorovastaava', 'vuorovastaava', 'labour', True), ('Työvoima', 'tyovoima', 'labour', True), ('Ohjelma', 'ohjelma', 'programme', True), ('Ohjelma 2. luokka', 'ohjelma-2lk', 'programme', False), ('Ohjelma 3. luokka', 'ohjelma-3lk', 'programme', False), ('Guest of Honour', 'goh', 'programme', False), # tervetullut muttei kutsuta automaattiviestillä ('Media', 'media', 'badges', False), ('Myyjä', 'myyja', 'badges', False), ('Vieras', 'vieras', 'badges', False), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if pc_afterparty and created: personnel_class.perks = [self.afterparty_perk] personnel_class.save() if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='tracon11'), target_event=self.event, remap_personnel_classes=dict(conitea='coniitti') ) labour_event_meta.create_groups() for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path='events.tracon2017.forms:OrganizerSignupForm', signup_extra_form_class_path='events.tracon2017.forms:OrganizerSignupExtraForm', active_from=datetime(2016, 10, 18, 15, 0o5, 0, tzinfo=self.tz), active_until=datetime(2017, 9, 10, 23, 59, 59, tzinfo=self.tz), ), ) for wiki_space, link_title, link_group in [ ('TERA', 'Työvoimawiki', 'accepted'), ('INFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://atlasso.tracon.fi/crowd?next=https://confluence.tracon.fi/display/{wiki_space}'.format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ) )
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, WorkPeriod, ) from ...models import SignupExtra from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time - timedelta(days=1), work_ends=self.event.end_time + timedelta(hours=4), admin_group=labour_admin_group, contact_email= 'Popcult Helsingin työvoimavastaava <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Vastaava', 'vastaava', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='popcultday2018'), target_event=self.event, ) labour_event_meta.create_groups() JobCategory.objects.filter(event=self.event, slug='vastaava').update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) if not jc.required_qualifications.exists(): jc.required_qualifications.set([qual]) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='vastaava', defaults=dict( title='Vastaavien ilmoittautumislomake', signup_form_class_path= 'events.popcult2019.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.popcult2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 11, 14, 0, 0, 0, tzinfo=self.tz), active_until=self.event.start_time, ), )
def setup_labour(self): from core.models import Person, Event from core.utils import slugify from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, PersonnelClass, Qualification, ) from ...models import SignupExtra, SpecialDiet from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time.replace(hour=8, minute=0, tzinfo=self.tz), work_ends=self.event.end_time.replace(hour=20, minute=0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email= 'Tampere Kupliin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Kuplitea', 'kuplitea', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Guest of Honour', 'goh', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') kuplitea = PersonnelClass.objects.get(event=self.event, slug='kuplitea') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='kuplii2019'), target_event=self.event, ) for name in ['Kuplitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='kuplitea', defaults=dict( title='Kuplitean ilmoittautumislomake', signup_form_class_path= 'events.kuplii2021.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.kuplii2021.forms:OrganizerSignupExtraForm', active_from=now(), active_until=self.event.end_time, ), ) for wiki_space, link_title, link_group in [ ('KUPLIIWORK', 'Työvoimawiki', 'accepted'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://confluence.tracon.fi/display/{wiki_space}'. format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ))
def setup_labour(self): from core.models import Person, Event from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, WorkPeriod, ) from ...models import SpecialDiet, SignupExtra, Night, Shift from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2017, 6, 30, 8, 0, tzinfo=self.tz), work_ends=datetime(2017, 7, 3, 16, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Kawacon <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Conitea', 'conitea', 'labour'), ('Vänkäri', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='kawacon2016'), target_event=self.event ) labour_event_meta.create_groups() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', 'Sunnuntain ja maanantain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path='events.kawacon2017.forms:OrganizerSignupForm', signup_extra_form_class_path='events.kawacon2017.forms:OrganizerSignupExtraForm', active_from=datetime(2017, 3, 15, 0, 0, 0, tzinfo=self.tz), active_until=self.event.end_time, ), ) for shift_name in [ 'Perjantaina', 'Lauantaina', 'Sunnuntaina', 'Sunnuntai-iltana ja maanantaina', ]: Shift.objects.get_or_create(name=shift_name)
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, PersonnelClass, Qualification, ) from ...models import SignupExtra, SpecialDiet, EventDay from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, # work_begins=self.event.start_time - timedelta(days=1), # work_ends=self.event.end_time + timedelta(hours=4), work_begins=datetime(2019, 2, 1, 0, 0, 0, tzinfo=self.tz), work_ends=datetime(2019, 3, 31, 0, 0, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Yukiconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Conitea', 'conitea', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') conitea = PersonnelClass.objects.get(event=self.event, slug='conitea') # for name, description, pcs in [ # ( # 'Conitea', # 'Tapahtuman järjestelytoimikunnan jäsen eli conitea', # [conitea] # ), # ( # 'Järjestyksenvalvoja', # 'Kävijöiden turvallisuuden valvominen conipaikalla ja yömajoituksessa. Edellyttää voimassa olevaa ' # 'JV-korttia ja asiakaspalveluasennetta. HUOM! Et voi valita tätä tehtävää hakemukseesi, ellet ole ' # 'täyttänyt tietoihisi JV-kortin numeroa (oikealta ylhäältä oma nimesi > Pätevyydet).', # [tyovoima] # ), # ]: # job_category, created = JobCategory.objects.get_or_create( # event=self.event, # slug=slugify(name), # defaults=dict( # name=name, # description=description, # ) # ) # if created: # job_category.personnel_classes = pcs # job_category.save() if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='yukicon2018'), target_event=self.event, ) for name in ['Conitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) for event_day in [ 'Perjantai (rakennuspäivä)', 'Lauantai', 'Sunnuntai', ]: EventDay.objects.get_or_create(name=event_day) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path= 'events.yukicon2019.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.yukicon2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 4, 26, 0, 0, 0, tzinfo=self.tz), active_until=self.event.start_time, ), ) for wiki_space, link_title, link_group in [ ('YUKICON2019', 'Coniteawiki', 'conitea'), # ('YUKIWORK', 'Työvoimawiki', 'accepted'), # ('YUKINFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://confluence.tracon.fi/display/{wiki_space}'. format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ))
def setup_labour(self): from core.models import Person, Event from core.utils import slugify from labour.models import ( AlternativeSignupForm, JobCategory, LabourEventMeta, PersonnelClass, Qualification, Survey, ) from ...models import SignupExtra, SpecialDiet from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2019, 2, 15, 8, 0, tzinfo=self.tz), work_ends=datetime(2019, 2, 17, 21, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Desuconin työvoimavastaava <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Vastaava', 'vastaava', 'labour'), ('Vuorovastaava', 'vuorovastaava', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Guest of Honour', 'goh', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') vastaava = PersonnelClass.objects.get(event=self.event, slug='vastaava') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='desucon2018'), target_event=self.event, ) for name in ['Vastaava']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() organizer_form, unused = AlternativeSignupForm.objects.get_or_create( event=self.event, slug='vastaava', defaults=dict( title='Vastaavan ilmoittautumislomake', signup_form_class_path='events.frostbite2019.forms:OrganizerSignupForm', signup_extra_form_class_path='events.frostbite2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 9, 16, 0, 0, 0, tzinfo=self.tz), active_until=self.event.start_time, ), ) if organizer_form.active_until is None: organizer_form.active_until = self.event.start_time organizer_form.save() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='xxlomake', defaults=dict( title='Erikoistehtävien ilmoittautumislomake', signup_form_class_path='events.frostbite2019.forms:SpecialistSignupForm', signup_extra_form_class_path='events.frostbite2019.forms:SpecialistSignupExtraForm', active_from=datetime(2018, 9, 16, 0, 0, 0, tzinfo=self.tz), active_until=self.event.start_time, signup_message=( 'Täytä tämä lomake vain, ' 'jos joku Desuconin vastaavista on ohjeistanut sinun ilmoittautua tällä lomakkeella. ' ), ), )
def setup_labour(self): from core.models import Person, Event from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, Perk, PersonnelClass, Survey, ) from ...models import SignupExtra, Night, GODWorkshopChoice from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2017, 9, 8, 8, 0, tzinfo=self.tz), work_ends=datetime(2017, 9, 10, 22, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Traconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) self.afterparty_perk, unused = Perk.objects.get_or_create( event=self.event, slug='kaatajaiset', defaults=dict(name='Kaatajaiset', ), ) fmh = PersonnelClass.objects.filter(event=self.event, slug='ylivankari') if fmh.exists(): fmh.update(name='Vuorovastaava', slug='vuorovastaava') for pc_name, pc_slug, pc_app_label, pc_afterparty in [ ('Coniitti', 'coniitti', 'labour', True), ('Duniitti', 'duniitti', 'labour', True), ('Vuorovastaava', 'vuorovastaava', 'labour', True), ('Työvoima', 'tyovoima', 'labour', True), ('Ohjelma', 'ohjelma', 'programme', True), ('Ohjelma 2. luokka', 'ohjelma-2lk', 'programme', False), ('Ohjelma 3. luokka', 'ohjelma-3lk', 'programme', False), ('Guest of Honour', 'goh', 'programme', False), # tervetullut muttei kutsuta automaattiviestillä ('Media', 'media', 'badges', False), ('Myyjä', 'myyja', 'badges', False), ('Vieras', 'vieras', 'badges', False), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if pc_afterparty and created: personnel_class.perks = [self.afterparty_perk] personnel_class.save() if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='tracon11'), target_event=self.event, remap_personnel_classes=dict(conitea='coniitti')) god_jc, created = JobCategory.objects.get_or_create( event=self.event, slug='god', defaults=dict( name='Peliä pyynnöstä', description= 'Peliä pyynnöstä -pisteen pelauttaja ja/tai sisäänheittäjä', ), ) if created: god_jc.personnel_classes = PersonnelClass.objects.filter( event=self.event, slug='tyovoima') god_jc.save() labour_event_meta.create_groups() for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path= 'events.tracon2017.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.tracon2017.forms:OrganizerSignupExtraForm', active_from=datetime(2016, 10, 18, 15, 5, 0, tzinfo=self.tz), active_until=datetime(2017, 9, 10, 23, 59, 59, tzinfo=self.tz), ), ) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='god', defaults=dict( title='Ilmoittautuminen Peliä pyynnöstä -pelinjohtajaksi', signup_form_class_path='events.tracon2017.forms:GODSignupForm', signup_extra_form_class_path= 'events.tracon2017.forms:GODSignupExtraForm', active_from=datetime(2017, 7, 18, 15, 5, 0, tzinfo=self.tz), active_until=datetime(2017, 9, 10, 23, 59, 59, tzinfo=self.tz), ), ) for god_choice_name in [ 'Livenä Tampereella', 'Internetissä', ]: GODWorkshopChoice.objects.get_or_create(name=god_choice_name) for wiki_space, link_title, link_group in [ ('TERA', 'Työvoimawiki', 'accepted'), ('INFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url= 'https://atlasso.tracon.fi/crowd?next=https://confluence.tracon.fi/display/{wiki_space}' .format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), )) Survey.objects.get_or_create( event=self.event, slug='tyovuorotoiveet', defaults=dict( title='Työvuorotoiveet', description= ('Tässä vaiheessa voit vaikuttaa työvuoroihisi. Jos saavut tapahtumaan vasta sen alkamisen ' 'jälkeen tai sinun täytyy lähteä ennen tapahtuman loppumista, kerro se tässä. Lisäksi jos ' 'tiedät ettet ole käytettävissä tiettyihin aikoihin tapahtuman aikana tai haluat esimerkiksi ' 'nähdä jonkun ohjelmanumeron, kerro siitäkin. Työvuorotoiveiden toteutumista täysin ei voida ' 'taata.'), form_class_path='events.tracon2017.forms:ShiftWishesSurvey', active_from=datetime(2017, 7, 3, 18, 50, 0, tzinfo=self.tz), active_until=datetime(2017, 8, 4, 23, 59, 59, tzinfo=self.tz), ), )
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, PersonnelClass, Qualification, ) from ...models import SignupExtra, SpecialDiet from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, # TODO bogus dates work_begins=datetime(2020, 7, 14, 10, 0, tzinfo=self.tz), work_ends=datetime(2020, 7, 15, 18, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Finnconin työvoimavastaava <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Conitea', 'conitea', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Kunniavieras', 'goh', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='finncon2018'), target_event=self.event, ) for name in ['Conitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path='events.finncon2020.forms:OrganizerSignupForm', signup_extra_form_class_path='events.finncon2020.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 10, 3, 16, 41, 0, tzinfo=self.tz), active_until=self.event.start_time, ), ) for wiki_space, link_title, link_group in [ # ('FINNCON2020', 'Finnconin työvoimawiki', 'accepted'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://confluence.tracon.fi/display/{wiki_space}'.format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ) )
def setup_labour(self): from core.models import Person, Event from core.utils import slugify from labour.models import ( AlternativeSignupForm, JobCategory, LabourEventMeta, PersonnelClass, Qualification, Survey, ) from mailings.models import RecipientGroup from ...models import SignupExtra, SpecialDiet from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time.replace(hour=8, minute=0, tzinfo=self.tz), work_ends=self.event.end_time.replace(hour=21, minute=0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Desuconin työvoimavastaava <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Vastaava', 'vastaava', 'labour'), ('Vuorovastaava', 'vuorovastaava', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Guest of Honour', 'goh', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') vastaava = PersonnelClass.objects.get(event=self.event, slug='vastaava') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='desucon2019'), target_event=self.event, ) for name in ['Vastaava']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() organizer_form, unused = AlternativeSignupForm.objects.get_or_create( event=self.event, slug='vastaava', defaults=dict( title='Vastaavan ilmoittautumislomake', signup_form_class_path= 'events.desucon2020.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.desucon2020.forms:OrganizerSignupExtraForm', active_from=self.event.created_at, active_until=self.event.start_time, ), ) if organizer_form.active_until is None: organizer_form.active_until = self.event.start_time organizer_form.save() for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='xxlomake', defaults=dict( title='Erikoistehtävien ilmoittautumislomake', signup_form_class_path= 'events.desucon2020.forms:SpecialistSignupForm', signup_extra_form_class_path= 'events.desucon2020.forms:SpecialistSignupExtraForm', active_from=self.event.created_at, active_until=self.event.start_time, signup_message= ('Täytä tämä lomake vain, ' 'jos joku Desuconin vastaavista on ohjeistanut sinun ilmoittautua tällä lomakkeella. ' ), ), ) # Survey.objects.get_or_create( # event=self.event, # slug='kaatoilmo', # defaults=dict( # title='Ilmoittautuminen kaatajaisiin', # description=( # 'Voidaksemme ilmoittaa erikoisruokavaliot mahdollisimman tarkasti pitopalvelulle ' # 'pyydämme ilmoittamaan, aiotko osallistua kaatajaisiin Desuconin purun jälkeen ' # 'sunnuntaina 10. kesäkuuta 2019 noin kello 19:00.' # ), # form_class_path='events.desucon2020.forms:AfterpartyParticipationSurvey', # active_from=datetime(2019, 6, 2, 21, 34, 0, tzinfo=self.tz), # active_until=datetime(2019, 6, 10, 23, 59, 59, tzinfo=self.tz), # ), # ) User = get_user_model() spam_group, = LabourEventMeta.get_or_create_groups( self.event, ['spam']) spam_group.user_set.set( User.objects.filter( person__may_send_info=True, person__signups__event__slug__in=[ 'frostbite2016', 'desucon2016', 'frostbite2017', 'desucon2017', 'frostbite2018', 'desucon2018', 'frostbite2019', 'desucon2019', ]).exclude(person__signups__event=self.event).distinct())
def setup_labour(self): from core.models import Person, Event from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, Survey, ) from ...models import SignupExtra, SpecialDiet, Night from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2017, 9, 8, 8, 0, tzinfo=self.tz), work_ends=datetime(2017, 9, 10, 22, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Traconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) self.afterparty_perk, unused = Perk.objects.get_or_create( event=self.event, slug='kaatajaiset', defaults=dict(name='Kaatajaiset', ), ) fmh = PersonnelClass.objects.filter(event=self.event, slug='ylivankari') if fmh.exists(): fmh.update(name='Vuorovastaava', slug='vuorovastaava') for pc_name, pc_slug, pc_app_label, pc_afterparty in [ ('Coniitti', 'coniitti', 'labour', True), ('Duniitti', 'duniitti', 'labour', True), ('Vuorovastaava', 'vuorovastaava', 'labour', True), ('Työvoima', 'tyovoima', 'labour', True), ('Ohjelma', 'ohjelma', 'programme', True), ('Ohjelma 2. luokka', 'ohjelma-2lk', 'programme', False), ('Ohjelma 3. luokka', 'ohjelma-3lk', 'programme', False), ('Guest of Honour', 'goh', 'programme', False), # tervetullut muttei kutsuta automaattiviestillä ('Media', 'media', 'badges', False), ('Myyjä', 'myyja', 'badges', False), ('Vieras', 'vieras', 'badges', False), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if pc_afterparty and created: personnel_class.perks = [self.afterparty_perk] personnel_class.save() if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='tracon11'), target_event=self.event, remap_personnel_classes=dict(conitea='coniitti')) labour_event_meta.create_groups() for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path= 'events.tracon2017.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.tracon2017.forms:OrganizerSignupExtraForm', active_from=datetime(2016, 10, 18, 15, 0o5, 0, tzinfo=self.tz), active_until=datetime(2017, 9, 10, 23, 59, 59, tzinfo=self.tz), ), ) for wiki_space, link_title, link_group in [ ('TERA', 'Työvoimawiki', 'accepted'), ('INFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url= 'https://atlasso.tracon.fi/crowd?next=https://confluence.tracon.fi/display/{wiki_space}' .format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ))
def setup_labour(self): from core.models import Event, Person from core.utils import slugify from labour.models import ( AlternativeSignupForm, InfoLink, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, Survey, ) from ...models import SignupExtra, Night, Poison from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=datetime(2019, 9, 6, 8, 0, tzinfo=self.tz), work_ends=datetime(2019, 9, 8, 22, 0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Traconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) else: pass labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) self.afterparty_perk, unused = Perk.objects.get_or_create( event=self.event, slug='kaatajaiset', defaults=dict( name='Kaatajaiset', ), ) fmh = PersonnelClass.objects.filter(event=self.event, slug='ylivankari') if fmh.exists(): fmh.update(name='Vuorovastaava', slug='vuorovastaava') for pc_name, pc_slug, pc_app_label, pc_afterparty in [ ('Coniitti', 'coniitti', 'labour', True), ('Duniitti', 'duniitti', 'labour', True), ('Vuorovastaava', 'vuorovastaava', 'labour', True), ('Työvoima', 'tyovoima', 'labour', True), ('Ohjelma', 'ohjelma', 'programme', True), ('Ohjelma 2. luokka', 'ohjelma-2lk', 'programme', False), ('Ohjelma 3. luokka', 'ohjelma-3lk', 'programme', False), ('Guest of Honour', 'goh', 'programme', False), # tervetullut muttei kutsuta automaattiviestillä ('Media', 'media', 'badges', False), ('Myyjä', 'myyja', 'badges', False), ('Vieras', 'vieras', 'badges', False), ('Vapaalippu, viikonloppu', 'vapaalippu-vkl', 'tickets', False), ('Vapaalippu, lauantai', 'vapaalippu-la', 'tickets', False), ('Vapaalippu, sunnuntai', 'vapaalippu-su', 'tickets', False), ('Cosplaykisaaja', 'cosplay', 'tickets', False), ('Taidekuja', 'taidekuja', 'tickets', False), ('Yhdistyspöydät', 'yhdistyspoydat', 'tickets', False), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if pc_afterparty and created: personnel_class.perks.set([self.afterparty_perk]) personnel_class.save() # v33 PersonnelClass.objects.filter( event=self.event, slug='coniitti', icon_css_class='fa-user', ).update( icon_css_class='fa-check-square' ) PersonnelClass.objects.filter( event=self.event, slug='duniitti', icon_css_class='fa-user', ).update( icon_css_class='fa-check-square-o' ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') coniitti = PersonnelClass.objects.get(event=self.event, slug='coniitti') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='tracon2018'), target_event=self.event, ) for name in ['Conitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) labour_event_meta.create_groups() for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path='events.tracon2019.forms:OrganizerSignupForm', signup_extra_form_class_path='events.tracon2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 9, 26, 12, 32, 0, tzinfo=self.tz), active_until=datetime(2019, 9, 8, 23, 59, 59, tzinfo=self.tz), ), ) for wiki_space, link_title, link_group in [ ('TERA', 'Työvoimawiki', 'accepted'), ('INFO', 'Infowiki', 'info'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://atlasso.tracon.fi/crowd?next=https://confluence.tracon.fi/display/{wiki_space}'.format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ) )
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, WorkPeriod, ) from ...models import SignupExtra from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time - timedelta(days=1), work_ends=self.event.end_time + timedelta(hours=4), admin_group=labour_admin_group, contact_email='Popcult Helsingin työvoimavastaava <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Vastaava', 'vastaava', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='popcultday2018'), target_event=self.event, ) labour_event_meta.create_groups() JobCategory.objects.filter(event=self.event, slug='vastaava').update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) if not jc.required_qualifications.exists(): jc.required_qualifications.set([qual]) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='vastaava', defaults=dict( title='Vastaavien ilmoittautumislomake', signup_form_class_path='events.popcult2019.forms:OrganizerSignupForm', signup_extra_form_class_path='events.popcult2019.forms:OrganizerSignupExtraForm', active_from=datetime(2018, 11, 14, 0, 0, 0, tzinfo=self.tz), active_until=self.event.start_time, ), )
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, WorkPeriod, ) from ...models import SignupExtra, SpecialDiet from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups( self.event, ['admins']) if self.test: person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time.replace(hour=8, minute=0, tzinfo=self.tz), work_ends=self.event.end_time.replace(hour=23, minute=0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Ropecon 2021 -työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Conitea', 'conitea', 'labour'), ('Vuorovastaava', 'ylivankari', 'labour'), ('Ylityöntekijä', 'ylityovoima', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Guest of Honour', 'goh', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ('Vieras', 'vieras', 'badges'), ('Vapaalippu', 'vapaalippu', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='ropecon2019'), target_event=self.event, ) labour_event_meta.create_groups() for name in ['Conitea']: JobCategory.objects.filter(event=self.event, name=name).update(public=False) for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path= 'events.ropecon2021.forms:OrganizerSignupForm', signup_extra_form_class_path= 'events.ropecon2021.forms:OrganizerSignupExtraForm', active_from=now(), active_until=self.event.end_time, ), )
def setup_labour(self): from core.models import Event, Person from labour.models import ( AlternativeSignupForm, InfoLink, Job, JobCategory, LabourEventMeta, Perk, PersonnelClass, Qualification, WorkPeriod, ) from ...models import SignupExtra, SpecialDiet, Night from django.contrib.contenttypes.models import ContentType labour_admin_group, = LabourEventMeta.get_or_create_groups(self.event, ['admins']) if self.test: from core.models import Person person, unused = Person.get_or_create_dummy() labour_admin_group.user_set.add(person.user) content_type = ContentType.objects.get_for_model(SignupExtra) labour_event_meta_defaults = dict( signup_extra_content_type=content_type, work_begins=self.event.start_time.replace(hour=12, minute=0, tzinfo=self.tz) - timedelta(days=1), work_ends=self.event.end_time.replace(hour=22, minute=0, tzinfo=self.tz), admin_group=labour_admin_group, contact_email='Nekoconin työvoimatiimi <*****@*****.**>', ) if self.test: t = now() labour_event_meta_defaults.update( registration_opens=t - timedelta(days=60), registration_closes=t + timedelta(days=60), ) labour_event_meta, unused = LabourEventMeta.objects.get_or_create( event=self.event, defaults=labour_event_meta_defaults, ) for pc_name, pc_slug, pc_app_label in [ ('Conitea', 'conitea', 'labour'), ('Työvoima', 'tyovoima', 'labour'), ('Ohjelmanjärjestäjä', 'ohjelma', 'programme'), ('Kunniavieras', 'goh', 'programme'), ('Media', 'media', 'badges'), ('Myyjä', 'myyja', 'badges'), ]: personnel_class, created = PersonnelClass.objects.get_or_create( event=self.event, slug=pc_slug, defaults=dict( name=pc_name, app_label=pc_app_label, priority=self.get_ordering_number(), ), ) tyovoima = PersonnelClass.objects.get(event=self.event, slug='tyovoima') conitea = PersonnelClass.objects.get(event=self.event, slug='conitea') if not JobCategory.objects.filter(event=self.event).exists(): JobCategory.copy_from_event( source_event=Event.objects.get(slug='nekocon2019'), target_event=self.event, ) JobCategory.objects.filter(event=self.event, name='Conitea').update(public=False) labour_event_meta.create_groups() for jc_name, qualification_name in [ ('Järjestyksenvalvoja', 'JV-kortti'), # (u'Green room', u'Hygieniapassi'), ]: jc = JobCategory.objects.get(event=self.event, name=jc_name) qual = Qualification.objects.get(name=qualification_name) jc.required_qualifications.set([qual]) period_length = timedelta(hours=8) for period_description, period_start in [ ("Perjantain kasaus (pe klo 12–21)", None), ("Lauantain aamuvuoro (la klo 08–14)", None), ("Lauantain iltapäivävuoro (la klo 14–20)", None), ("Lauantain iltavuoro (la klo 20–02)", None), ("Lauantai–sunnuntai-yövuoro (su klo 02–08)", None), ("Sunnuntain aamuvuoro (su klo 08–14)", None), ("Sunnuntain iltapäivävuoro ja purku (su klo 14–20)", None), ]: WorkPeriod.objects.get_or_create( event=self.event, description=period_description, defaults=dict( start_time=period_start, end_time=(period_start + period_length) if period_start else None, ) ) for diet_name in [ 'Gluteeniton', 'Laktoositon', 'Maidoton', 'Vegaaninen', 'Lakto-ovo-vegetaristinen', ]: SpecialDiet.objects.get_or_create(name=diet_name) for night in [ 'Perjantain ja lauantain välinen yö', 'Lauantain ja sunnuntain välinen yö', 'Sunnuntain ja maanantain välinen yö', ]: Night.objects.get_or_create(name=night) AlternativeSignupForm.objects.get_or_create( event=self.event, slug='conitea', defaults=dict( title='Conitean ilmoittautumislomake', signup_form_class_path='events.nekocon2020.forms:OrganizerSignupForm', signup_extra_form_class_path='events.nekocon2020.forms:OrganizerSignupExtraForm', active_from=now(), active_until=self.event.end_time, ), ) for wiki_space, link_title, link_group in [ ('NEKOCON2020', 'Coniteawiki', 'conitea'), # ('NEKOWORK', 'Työvoimawiki', 'accepted'), ]: InfoLink.objects.get_or_create( event=self.event, title=link_title, defaults=dict( url='https://confluence.tracon.fi/display/{wiki_space}'.format(wiki_space=wiki_space), group=labour_event_meta.get_group(link_group), ) )