本文整理汇总了Python中programme.models.ProgrammeEventMeta类的典型用法代码示例。如果您正苦于以下问题:Python ProgrammeEventMeta类的具体用法?Python ProgrammeEventMeta怎么用?Python ProgrammeEventMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProgrammeEventMeta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
self.meta, unused = BadgesEventMeta.get_or_create_dummy()
LabourEventMeta.get_or_create_dummy()
ProgrammeEventMeta.get_or_create_dummy()
self.event = self.meta.event
self.person, unused = Person.get_or_create_dummy()
示例2: handle
def handle(*args, **options):
tz = tzlocal()
venue, unused = Venue.objects.get_or_create(
name="Peltolan ammattiopisto",
defaults=dict(name_inessive="Peltolan ammattiopistolla"), # XXX not really inessive
)
room_order = 0
for room_name in [
# u'Auditorio',
# u'Pääsali',
# u'E-rakennus, luokat',
# u'Kawaplay, G-rakennus',
# u'Elokuvateatteri Tapio',
]:
room_order += 100
Room.objects.get_or_create(venue=venue, name=room_name, defaults=dict(order=room_order))
event, unused = Event.objects.get_or_create(
slug="kawacon2014",
defaults=dict(
name="Kawacon 2014",
name_genitive="Kawacon 2014 -tapahtuman",
name_illative="Kawacon 2014 -tapahtumaan",
name_inessive="Kawacon 2014 -tapahtumassa",
homepage_url="http://kawacon.info",
organization_name="Kawacon ry",
organization_url="http://kawacon.info",
start_time=datetime(2014, 6, 28, 10, 0, tzinfo=tz),
end_time=datetime(2014, 6, 29, 18, 0, tzinfo=tz),
venue=venue,
),
)
admin_group, = ProgrammeEventMeta.get_or_create_groups(event, ["admins"])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(
event=event, defaults=dict(public=False, admin_group=admin_group)
)
view, unused = View.objects.get_or_create(event=event, name="Ohjelmakartta")
if not view.rooms.exists():
view.rooms = Room.objects.filter(venue=venue)
view.save()
for category_name, category_style in [
(u"Luento", u"anime"),
(u"Non-stop", u"miitti"),
(u"Työpaja", u"rope"),
(u"Muu ohjelma", u"muu"),
(u"Show", u"cosplay"),
]:
Category.objects.get_or_create(event=event, title=category_name, defaults=dict(style=category_style))
for start_time, end_time in [
(datetime(2014, 6, 28, 10, 0, 0, tzinfo=tz), datetime(2014, 6, 28, 18, 0, 0, tzinfo=tz)),
(datetime(2014, 6, 29, 10, 0, 0, tzinfo=tz), datetime(2014, 6, 29, 16, 0, 0, tzinfo=tz)),
]:
TimeBlock.objects.get_or_create(event=event, start_time=start_time, defaults=dict(end_time=end_time))
示例3: setup_programme
def setup_programme(self):
from django.contrib.auth.models import Group
from labour.models import PersonnelClass, LabourEventMeta
from programme.models import (
Category,
Programme,
ProgrammeEventMeta,
Role,
)
ProgrammeEventMeta.get_or_create_groups(self.event, ['hosts'])
programme_admin_group = Group.objects.get(name=LabourEventMeta.make_group_name(self.event, 'vastaava'))
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Desuconin ohjelmavastaava <[email protected]>',
))
personnel_class = PersonnelClass.objects.get(event=self.event, slug='ohjelma')
role_priority = 0
for role_title in [
'Ohjelmanjärjestäjä',
'Panelisti',
'Työpajanpitäjä',
'Keskustelupiirin vetäjä',
]:
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=True,
require_contact_info=True,
priority=role_priority,
)
)
role_priority += 10
示例4: setup_programme
def setup_programme(self):
from programme.models import Room, ProgrammeEventMeta, Category, TimeBlock, View
room_order = 0
for room_name in [
# u'Auditorio',
# u'Pääsali',
# u'E-rakennus, luokat',
# u'Kawaplay, G-rakennus',
# u'Elokuvateatteri Tapio',
]:
room_order += 100
Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=room_order,
)
)
admin_group, = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
admin_group=admin_group,
))
view, unused = View.objects.get_or_create(
event=self.event,
name='Ohjelmakartta',
)
if not view.rooms.exists():
view.rooms = Room.objects.filter(venue=self.venue)
view.save()
for category_name, category_style in [
(u'Luento', u'anime'),
(u'Non-stop', u'miitti'),
(u'Työpaja', u'rope'),
(u'Muu ohjelma', u'muu'),
(u'Show', u'cosplay'),
]:
Category.objects.get_or_create(
event=self.event,
title=category_name,
defaults=dict(
style=category_style,
)
)
for start_time, end_time in [
(
self.event.start_time,
self.event.start_time.replace(hour=18),
),
(
self.event.end_time.replace(hour=10),
self.event.end_time,
),
]:
TimeBlock.objects.get_or_create(
event=self.event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
示例5: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
from ...models import TimeSlot
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Tracon Hitpoint -ohjelmatiimi <[email protected]>',
schedule_layout='reasonable',
))
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
# ('ohjelma-2lk', 'Ohjelmanjärjestäjä (2. luokka)', False),
# ('ohjelma-3lk', 'Ohjelmanjärjestäjä (3. luokka)', False),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, slug, style in [
('Larp', 'larp', 'color1'),
('Lautapelit', 'lautapelit', 'color2'),
('Puheohjelma', 'puheohjelma', 'color3'),
('Roolipeli', 'roolipeli', 'color4'),
('Freeform', 'freeform', 'color1'),
('Korttipelit', 'korttipelit', 'color5'),
('Figupelit', 'figupelit', 'color6'),
('Muu ohjelma', 'muu-ohjelma', 'color7'),
('Sisäinen ohjelma', 'sisainen-ohjelma', 'sisainen'),
]:
Category.objects.get_or_create(
event=self.event,
slug=slug,
defaults=dict(
title=title,
style=style,
public=style != 'sisainen',
)
)
for start_time, end_time in [
(
datetime(2019, 11, 23, 10, 0, tzinfo=self.tz),
datetime(2019, 11, 24, 1, 0, tzinfo=self.tz),
),
(
datetime(2019, 11, 24, 9, 0, tzinfo=self.tz),
datetime(2019, 11, 24, 18, 0, tzinfo=self.tz),
),
]:
TimeBlock.objects.get_or_create(
event=self.event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
for time_block in TimeBlock.objects.filter(event=self.event):
# Half hours
# [:-1] – discard 18:30
for hour_start_time in full_hours_between(time_block.start_time, time_block.end_time)[:-1]:
SpecialStartTime.objects.get_or_create(
event=self.event,
start_time=hour_start_time.replace(minute=30)
)
AlternativeProgrammeForm.objects.get_or_create(
event=self.event,
slug='rpg',
defaults=dict(
title='Tarjoa pöytäroolipeliä',
description='',
programme_form_code='events.hitpoint2019.forms:RpgForm',
num_extra_invites=0,
order=10,
#.........这里部分代码省略.........
示例6: handle
def handle(*args, **options):
if options['test']:
print 'Setting up concon9 in test mode'
else:
print 'Setting up concon9 in production mode'
tz = tzlocal()
venue, unused = Venue.objects.get_or_create(
name=u'Metropolia AMK Hämeentie',
defaults=dict(
name_inessive=u'Metropolia AMK:n Hämeentien toimipisteessä'
)
)
room_order = 0
for room_name in [
u'Zeus',
u'Athene',
]:
room_order += 100
Room.objects.get_or_create(
venue=venue,
name=room_name,
defaults=dict(
order=room_order,
)
)
event, unused = Event.objects.get_or_create(slug='concon9', defaults=dict(
name='Concon 9',
name_genitive='Concon 9 -seminaarin',
name_illative='Concon 9 -seminaariin',
name_inessive='Concon 9 -seminaarissa',
homepage_url='http://concon.nakkikone.org',
organization_name='Yliopiston anime ja manga ry',
organization_url='http://yama.animeunioni.org',
start_time=datetime(2014, 5, 24, 10, 0, tzinfo=tz),
end_time=datetime(2014, 5, 24, 18, 0, tzinfo=tz),
venue=venue,
))
admin_group, unused = ProgrammeEventMeta.get_or_create_group(event=event, suffix='admins')
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=event, defaults=dict(
public=False,
admin_group=admin_group,
))
view, unused = View.objects.get_or_create(
event=event,
name='Ohjelmakartta',
)
view.rooms = Room.objects.filter(venue=venue, public=True)
view.save()
for category_name, category_style in [
(u'Ohjelma', u'anime'),
(u'Tauko', u'muu'),
]:
Category.objects.get_or_create(
event=event,
title=category_name,
defaults=dict(
style=category_style,
)
)
for start_time, end_time in [
(
event.start_time,
event.end_time,
),
]:
TimeBlock.objects.get_or_create(
event=event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
# half_hour = event.start_time + timedelta(minutes=30)
# while half_hour < end_time:
# SpecialStartTime.objects.create(
# event=event,
# start_time=half_hour,
# )
# half_hour += timedelta(minutes=60)
示例7: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
Programme,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Tracon -ohjelmatiimi <[email protected]>',
schedule_layout='full_width',
))
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for room_name in [
# 'Aaria',
# 'Iso sali',
# 'Pieni sali',
# # 'Sopraano', # Not in programme use
# 'Rondo',
# 'Studio',
# 'Sonaatti 1',
# 'Sonaatti 2',
# # 'Basso', # No longer exists
# # 'Opus 1', # No longer exists
# 'Opus 2',
# 'Opus 3',
# 'Opus 4',
# 'Talvipuutarha',
# 'Puistolava',
# 'Pieni ulkolava',
# 'Puisto - Iso miittiteltta',
# 'Puisto - Pieni miittiteltta',
# 'Puisto - Bofferiteltta',
# 'Muualla ulkona',
# 'Duetto 2',
# 'Riffi',
# 'Maestro',
]:
order = self.get_ordering_number() + 90000 # XXX
room, created = Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=order
)
)
room.order = order
room.save()
for room_name in [
# 'Sopraano',
# 'Basso',
# 'Opus 1',
]:
room = Room.objects.get(venue=self.venue, name=room_name)
room.active = False
room.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
('ohjelma-2lk', 'Ohjelmanjärjestäjä (2. luokka)', False),
('ohjelma-3lk', 'Ohjelmanjärjestäjä (3. luokka)', False),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, style in [
('Animeohjelma', 'anime'),
('Cosplayohjelma', 'cosplay'),
('Miitti', 'miitti'),
('Muu ohjelma', 'muu'),
('Roolipeliohjelma', 'rope'),
]:
Category.objects.get_or_create(
event=self.event,
style=style,
#.........这里部分代码省略.........
示例8: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
ProgrammeEventMeta,
Role,
SpecialStartTime,
Tag,
TimeBlock,
View,
)
from core.utils import full_hours_between
admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
admin_group=admin_group,
))
if not programme_event_meta.contact_email:
programme_event_meta.contact_email = 'Finnconin ohjelmavastaava <[email protected]>'
programme_event_meta.save()
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
for category_name, category_style in [
('Luento', 'color1'),
('Paneeli', 'color2'),
('Muu', 'color3'),
]:
Category.objects.get_or_create(
event=self.event,
title=category_name,
defaults=dict(
style=category_style,
)
)
for tag_name, tag_style in [
]:
Tag.objects.get_or_create(
event=self.event,
title=tag_name,
defaults=dict(
style=tag_style,
),
)
if not TimeBlock.objects.filter(event=self.event).exists():
for start_time, end_time in [
(
self.event.start_time,
self.event.start_time.replace(hour=22, tzinfo=self.tz),
),
(
self.event.end_time.replace(hour=9, tzinfo=self.tz),
self.event.end_time,
),
]:
TimeBlock.objects.get_or_create(
event=self.event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
for time_block in TimeBlock.objects.filter(event=self.event):
# Half hours
# [:-1] – discard 18:30
for hour_start_time in full_hours_between(time_block.start_time, time_block.end_time)[:-1]:
SpecialStartTime.objects.get_or_create(
event=self.event,
start_time=hour_start_time.replace(minute=30)
)
default_form, created = AlternativeProgrammeForm.objects.get_or_create(
event=self.event,
slug='default',
defaults=dict(
title='Tarjoa ohjelmaa',
programme_form_code='events.finncon2018.forms:ProgrammeForm',
num_extra_invites=3,
),
)
示例9: setup_programme
def setup_programme(self):
from core.utils import full_hours_between
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
room_order = 0
for room_name in [
'Auditorio',
'Yläkerran aula',
'Piha',
'Pokemonhuone',
'Miittiluokka',
'Työpajaluokka',
'Karaokeluokka',
'Artemisluokka',
]:
room_order += 100
Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=room_order,
)
)
admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
admin_group=admin_group,
schedule_layout='full_width',
contact_email='Kawacon ohjelma <[email protected]>',
))
view, unused = View.objects.get_or_create(
event=self.event,
name='Ohjelmakartta',
)
if not view.rooms.exists():
view.rooms = Room.objects.filter(venue=self.venue, active=True)
view.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
for category_name, category_style in [
('Puheohjelma', 'color1'),
('Viihdeohjelma', 'color2'),
('Jatkuva ohjelma', 'color3'),
('Mitti', 'color4'),
('Muu ohjelma', 'color5'),
('Ulko-ohjelma', 'color6'),
('Peliohjelma', 'color7'),
('Työpaja', 'color4'),
('Pokemonohjelma', 'color7'),
('Cosplayohjelma', 'color5'),
]:
Category.objects.get_or_create(
event=self.event,
title=category_name,
defaults=dict(
style=category_style,
)
)
for start_time, end_time in [
(
self.event.start_time,
self.event.start_time.replace(hour=18),
),
(
self.event.end_time.replace(hour=10),
self.event.end_time,
),
]:
TimeBlock.objects.get_or_create(
event=self.event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
#.........这里部分代码省略.........
示例10: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
Category,
Programme,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
Tag,
TimeBlock,
View,
)
from core.utils import full_hours_between
for room_name in [
'Suuri sali',
'Tarvehuone',
'Tähtitorni',
'Loitsuluokka',
]:
Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=self.get_ordering_number(),
)
)
admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
admin_group=admin_group,
))
if not programme_event_meta.contact_email:
programme_event_meta.contact_email = 'Tylyconin ohjelmavastaava <[email protected]>'
programme_event_meta.save()
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
view, unused = View.objects.get_or_create(
event=self.event,
name='Ohjelmakartta',
)
if not view.rooms.exists():
view.rooms = Room.objects.filter(venue=self.venue, active=True)
view.save()
for category_name, category_style in [
('Puheohjelma', 'color1'),
('Keskusteluohjelma', 'color2'),
('Työpaja', 'color3'),
('Muu ohjelma', 'color4'),
]:
Category.objects.get_or_create(
event=self.event,
title=category_name,
defaults=dict(
style=category_style,
)
)
for tag_name, tag_style in [
]:
Tag.objects.get_or_create(
event=self.event,
title=tag_name,
defaults=dict(
style=tag_style,
),
)
TimeBlock.objects.get_or_create(
event=self.event,
start_time=self.event.start_time,
defaults=dict(
end_time=self.event.end_time,
),
)
示例11: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
from ...models import TimeSlot
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Ropecon 2018 -ohjelmatiimi <[email protected]>',
schedule_layout='reasonable',
))
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
if not Room.objects.filter(event=self.event).exists():
for room_name in [
'Halli 3',
'Halli 3 Bofferialue',
'Halli 1 Myyntialue',
'Halli 3 Näyttelyalue',
'Halli 3 Korttipelialue',
'Halli 3 Figupelialue',
'Halli 3 Pukukilpailutiski',
'Halli 3 Ohjelmalava',
'Halli 3 Puhesali',
'Halli 3 Ohjelmasali',
'Ylä-Galleria',
'Ala-Galleria',
'Larp-tiski',
'Messuaukio',
'Klubiravintola',
'Sali 103',
'Sali 201',
'Sali 202',
'Sali 203a',
'Sali 203b',
'Sali 204',
'Sali 205',
'Sali 206',
'Sali 207',
'Sali 211',
'Sali 212',
'Sali 213',
'Sali 214',
'Sali 215',
'Sali 216',
'Sali 216a',
'Sali 217',
'Sali 218',
'Sali 301',
'Sali 302',
'Sali 303',
'Sali 304',
'Sali 305',
'Sali 306',
'Sali 307',
'Salin 203 aula',
]:
room, created = Room.objects.get_or_create(
event=self.event,
name=room_name,
)
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
('ohjelma', 'Pelinjohtaja', False),
('ohjelma', 'Pelinjärjestäjä', False),
('ohjelma', 'Peliesittelijä', False),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, slug, style in [
('Larp', 'larp', 'color1'),
('Lautapelit', 'lautapeli', 'color2'),
('Puheohjelma', 'puheohjelma', 'color3'),
('Roolipeli', 'roolipeli', 'color4'),
('Korttipelit', 'korttipeli', 'color5'),
('Figupelit', 'figupeli', 'color6'),
#.........这里部分代码省略.........
示例12: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
Category,
Programme,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Finncon 2016 -ohjelmatiimi <[email protected]>',
))
personnel_class = PersonnelClass.objects.get(event=self.event, slug='ohjelma')
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title='Ohjelmanjärjestäjä',
defaults=dict(
is_default=True,
require_contact_info=True,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, style in [
('Puheohjelma', 'anime'),
('Akateeminen ohjelma', 'cosplay'),
('Miitti', 'miitti'),
('Työpaja', 'rope'),
('Muu ohjelma', 'muu'),
]:
Category.objects.get_or_create(
event=self.event,
style=style,
defaults=dict(
title=title,
)
)
for start_time, end_time in [
(
datetime(2016, 7, 1, 12, 0, 0, tzinfo=self.tz),
datetime(2016, 7, 1, 18, 0, 0, tzinfo=self.tz),
),
(
datetime(2016, 7, 2, 10, 0, 0, tzinfo=self.tz),
datetime(2016, 7, 2, 18, 0, 0, tzinfo=self.tz),
),
(
datetime(2016, 7, 3, 10, 0, 0, tzinfo=self.tz),
datetime(2016, 7, 3, 18, 0, 0, tzinfo=self.tz),
),
]:
TimeBlock.objects.get_or_create(
event=self.event,
start_time=start_time,
defaults=dict(
end_time=end_time
)
)
# SpecialStartTime.objects.get_or_create(
# event=self.event,
# start_time=datetime(2016, 9, 5, 10, 30, 0, tzinfo=self.tz),
# )
for view_name, room_names in [
('Pääohjelmatilat', [
'Juhlasali',
'Auditorio A1',
'Luentosali A3',
'Luentosali A4',
]),
('Toissijaiset ohjelmatilat', [
'Auditorio D10a',
'Auditorio D10b',
'Auditorio D11',
'Luentosali A05',
]),
]:
rooms = [
Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=self.get_ordering_number(),
)
)[0]
for room_name in room_names
]
#.........这里部分代码省略.........
示例13: create_event_with_programme
def create_event_with_programme(context):
context.meta, unused = ProgrammeEventMeta.get_or_create_dummy()
context.event = context.meta.event
示例14: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
Category,
Programme,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Tracon -ohjelmatiimi <[email protected]>',
schedule_layout='full_width',
))
# v48
programme_event_meta.schedule_layout = 'full_width'
programme_event_meta.save()
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for room_name in [
'Aaria',
'Iso sali',
'Pieni sali',
# 'Sopraano', # Not in programme use
'Rondo',
'Studio',
'Sonaatti 1',
'Sonaatti 2',
# 'Basso', # No longer exists
# 'Opus 1', # No longer exists
'Opus 2',
'Opus 3',
'Opus 4',
'Talvipuutarha',
'Puistolava',
'Pieni ulkolava',
'Puisto - Iso miittiteltta',
'Puisto - Pieni miittiteltta',
'Puisto - Bofferiteltta',
'Muualla ulkona',
'Duetto 2',
'Riffi',
'Maestro',
]:
order = self.get_ordering_number() + 90000 # XXX
room, created = Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=order
)
)
room.order = order
room.save()
for room_name in [
# 'Sopraano',
# 'Basso',
# 'Opus 1',
]:
room = Room.objects.get(venue=self.venue, name=room_name)
room.active = False
room.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
('ohjelma-2lk', 'Ohjelmanjärjestäjä (2. luokka)', False),
('ohjelma-3lk', 'Ohjelmanjärjestäjä (3. luokka)', False),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, style in [
('Animeohjelma', 'anime'),
('Cosplayohjelma', 'cosplay'),
('Miitti', 'miitti'),
('Muu ohjelma', 'muu'),
('Roolipeliohjelma', 'rope'),
]:
#.........这里部分代码省略.........
示例15: setup_programme
def setup_programme(self):
from labour.models import PersonnelClass
from programme.models import (
AlternativeProgrammeForm,
Category,
ProgrammeEventMeta,
Role,
Room,
SpecialStartTime,
TimeBlock,
View,
)
from ...models import TimeSlot
programme_admin_group, hosts_group = ProgrammeEventMeta.get_or_create_groups(self.event, ['admins', 'hosts'])
programme_event_meta, unused = ProgrammeEventMeta.objects.get_or_create(event=self.event, defaults=dict(
public=False,
admin_group=programme_admin_group,
contact_email='Tracon Hitpoint -ohjelmatiimi <[email protected]>',
schedule_layout='reasonable',
))
if settings.DEBUG:
programme_event_meta.accepting_cold_offers_from = now() - timedelta(days=60)
programme_event_meta.accepting_cold_offers_until = now() + timedelta(days=60)
programme_event_meta.save()
for room_name in [
# 'Aaria',
# 'Iso sali',
# 'Pieni sali',
# # 'Sopraano', # Not in programme use
# 'Rondo',
# 'Studio',
# 'Sonaatti 1',
# 'Sonaatti 2',
# # 'Basso', # No longer exists
# # 'Opus 1', # No longer exists
# 'Opus 2',
# 'Opus 3',
# 'Opus 4',
# 'Talvipuutarha',
# 'Puistolava',
# 'Pieni ulkolava',
# 'Puisto - Iso miittiteltta',
# 'Puisto - Pieni miittiteltta',
# 'Puisto - Bofferiteltta',
# 'Muualla ulkona',
# 'Duetto 2',
# 'Riffi',
# 'Maestro',
]:
order = self.get_ordering_number() + 90000 # XXX
room, created = Room.objects.get_or_create(
venue=self.venue,
name=room_name,
defaults=dict(
order=order
)
)
room.order = order
room.save()
for room_name in [
# 'Sopraano',
# 'Basso',
# 'Opus 1',
]:
room = Room.objects.get(venue=self.venue, name=room_name)
room.active = False
room.save()
for pc_slug, role_title, role_is_default in [
('ohjelma', 'Ohjelmanjärjestäjä', True),
# ('ohjelma-2lk', 'Ohjelmanjärjestäjä (2. luokka)', False),
# ('ohjelma-3lk', 'Ohjelmanjärjestäjä (3. luokka)', False),
]:
personnel_class = PersonnelClass.objects.get(event=self.event, slug=pc_slug)
role, unused = Role.objects.get_or_create(
personnel_class=personnel_class,
title=role_title,
defaults=dict(
is_default=role_is_default,
)
)
have_categories = Category.objects.filter(event=self.event).exists()
if not have_categories:
for title, slug, style in [
('Larp', 'larp', 'color1'),
('Lautapelit', 'lautapelit', 'color2'),
('Puheohjelma', 'puheohjelma', 'color3'),
('Roolipeli', 'roolipeli', 'color4'),
('Freeform', 'freeform', 'color1'),
('Korttipelit', 'korttipelit', 'color5'),
('Figupelit', 'figupelit', 'color6'),
('Muu ohjelma', 'muu-ohjelma', 'color7'),
('Sisäinen ohjelma', 'sisainen-ohjelma', 'sisainen'),
#.........这里部分代码省略.........