當前位置: 首頁>>代碼示例>>Python>>正文


Python models.ProgrammeEventMeta類代碼示例

本文整理匯總了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()
開發者ID:Hilzu,項目名稱:kompassi,代碼行數:7,代碼來源:tests.py

示例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))
開發者ID:Hilzu,項目名稱:kompassi,代碼行數:60,代碼來源:setup_kawacon2014.py

示例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
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:37,代碼來源:setup_desucon2016.py

示例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
                )
            )
開發者ID:akx,項目名稱:kompassi,代碼行數:66,代碼來源:setup_kawacon2016.py

示例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,
#.........這裏部分代碼省略.........
開發者ID:tracon,項目名稱:kompassi,代碼行數:101,代碼來源:setup_hitpoint2019.py

示例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)
開發者ID:wyrmiyu,項目名稱:kompassi,代碼行數:90,代碼來源:setup_concon9.py

示例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,
#.........這裏部分代碼省略.........
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:101,代碼來源:setup_tracon2017.py

示例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,
            ),
        )
開發者ID:tracon,項目名稱:kompassi,代碼行數:100,代碼來源:setup_finncon2018.py

示例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
                )
            )

#.........這裏部分代碼省略.........
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:101,代碼來源:setup_kawacon2017.py

示例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,
            ),
        )
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:95,代碼來源:setup_tylycon2017.py

示例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'),
#.........這裏部分代碼省略.........
開發者ID:tracon,項目名稱:kompassi,代碼行數:101,代碼來源:setup_ropecon2018.py

示例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
            ]

#.........這裏部分代碼省略.........
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:101,代碼來源:setup_finncon2016.py

示例13: create_event_with_programme

def create_event_with_programme(context):
    context.meta, unused = ProgrammeEventMeta.get_or_create_dummy()
    context.event = context.meta.event
開發者ID:wyrmiyu,項目名稱:kompassi,代碼行數:3,代碼來源:programme_self_service_steps.py

示例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'),
            ]:
#.........這裏部分代碼省略.........
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:101,代碼來源:setup_tracon11.py

示例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'),
#.........這裏部分代碼省略.........
開發者ID:Siikakala,項目名稱:kompassi,代碼行數:101,代碼來源:setup_hitpoint2017.py


注:本文中的programme.models.ProgrammeEventMeta類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。