当前位置: 首页>>代码示例>>Python>>正文


Python IEventBasic.start方法代码示例

本文整理汇总了Python中plone.app.event.dx.behaviors.IEventBasic.start方法的典型用法代码示例。如果您正苦于以下问题:Python IEventBasic.start方法的具体用法?Python IEventBasic.start怎么用?Python IEventBasic.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plone.app.event.dx.behaviors.IEventBasic的用法示例。


在下文中一共展示了IEventBasic.start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_phone_or_cellphone

# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import start [as 别名]
 def test_phone_or_cellphone(self):
     add_behavior('Event', IRelatedContacts.__identifier__)
     timezone = 'Europe/Brussels'
     now = datetime.datetime.now()
     self.event = api.content.create(
         container=self.portal,
         type='Event',
         id='event')
     self.event.timezone = timezone
     eventbasic = IEventBasic(self.event)
     eventbasic.start = datetime.datetime(now.year, now.month, now.day, 18)
     eventbasic.end = datetime.datetime(now.year, now.month, now.day, 21)
     self.event.reindexObject()
     view = getMultiAdapter(
         (self.event, self.request), name='event_summary')
     person, organization1, organization2 = add_test_contents(self.portal)
     organization1.phone = ['081/586.100']
     phone_or_cellphone = view.get_phone_or_cellphone(organization1)
     self.assertEqual(phone_or_cellphone[0].get('formated'),
                      '+32 (0) 81 58 61 00')
     organization1.phone = []
     phone_or_cellphone = view.get_phone_or_cellphone(organization1)
     self.assertEqual(len(phone_or_cellphone), 0)
     organization1.cell_phone = ['081/586.101']
     phone_or_cellphone = view.get_phone_or_cellphone(organization1)
     self.assertEqual(phone_or_cellphone[0].get('formated'),
                      '+32 (0) 81 58 61 01')
开发者ID:IMIO,项目名称:cpskin.agenda,代码行数:29,代码来源:test_views.py

示例2: test_related_contacts_behavior_view_for_partners

# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import start [as 别名]
    def test_related_contacts_behavior_view_for_partners(self):
        add_behavior('Event', IRelatedContacts.__identifier__)
        timezone = 'Europe/Brussels'
        now = datetime.datetime.now()
        self.event = api.content.create(
            container=self.portal,
            type='Event',
            id='event')
        self.event.timezone = timezone
        eventbasic = IEventBasic(self.event)
        eventbasic.start = datetime.datetime(now.year, now.month, now.day, 18)
        eventbasic.end = datetime.datetime(now.year, now.month, now.day, 21)
        self.event.reindexObject()
        view = getMultiAdapter(
            (self.event, self.request), name='event_summary')
        self.assertNotIn('partners', view())

        person, organization1, organization2 = add_test_contents(self.portal)

        # set related contact
        intids = getUtility(IIntIds)
        to_id1 = intids.getId(person)
        to_id2 = intids.getId(organization2)
        rv1 = RelationValue(to_id1)
        rv2 = RelationValue(to_id2)
        self.event.partners = [rv1, rv2]
        self.assertIn('partners', view())
开发者ID:IMIO,项目名称:cpskin.agenda,代码行数:29,代码来源:test_views.py

示例3: test_related_contacts_behavior_view_for_contact

# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import start [as 别名]
    def test_related_contacts_behavior_view_for_contact(self):
        add_behavior('Event', IRelatedContacts.__identifier__)
        timezone = 'Europe/Brussels'
        now = datetime.datetime.now()
        self.event = api.content.create(
            container=self.portal,
            type='Event',
            id='event')
        self.event.timezone = timezone
        eventbasic = IEventBasic(self.event)
        eventbasic.start = datetime.datetime(now.year, now.month, now.day, 18)
        eventbasic.end = datetime.datetime(now.year, now.month, now.day, 21)
        self.event.reindexObject()
        view = getMultiAdapter(
            (self.event, self.request), name='event_summary')
        person, organization1, organization2 = add_test_contents(self.portal)

        # set related contact
        intids = getUtility(IIntIds)
        to_id = intids.getId(organization1)
        rv = RelationValue(to_id)
        self.event.contact = rv
        self.assertEqual(
            view.get_website(organization1),
            None
        )
        organization1.website = 'www.foo.bar'
        self.assertEqual(
            view.get_website(organization1),
            '<a class="event_website" href="http://www.foo.bar" target="_blank">www.foo.bar</a>'  # noqa
        )
开发者ID:IMIO,项目名称:cpskin.agenda,代码行数:33,代码来源:test_views.py

示例4: set_event_fields

# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import start [as 别名]
 def set_event_fields(self, obj, data):
     self.set_fields(obj, data)
     #
     event = IEventBasic(obj)
     start = DateTime(data["startDate"]["value"])
     event.start = self.format_datetime(start)
     end = DateTime(data["endDate"]["value"])
     event.end = self.format_datetime(end)
     event.timezone = 'CET'
开发者ID:interaktivgmbh,项目名称:interaktiv.migrator_p3,代码行数:11,代码来源:import_utility.py

示例5: test_event_view_without_behavior

# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import start [as 别名]
 def test_event_view_without_behavior(self):
     timezone = 'Europe/Brussels'
     now = datetime.datetime.now()
     self.event = api.content.create(
         container=self.portal,
         type='Event',
         id='event')
     self.event.timezone = timezone
     self.event.location = u'Mon adresse'
     eventbasic = IEventBasic(self.event)
     eventbasic.start = datetime.datetime(now.year, now.month, now.day, 18)
     eventbasic.end = datetime.datetime(now.year, now.month, now.day, 21)
     self.event.reindexObject()
     view = getMultiAdapter(
         (self.event, self.request), name='event_summary')
     self.assertNotIn('partners', view())
开发者ID:IMIO,项目名称:cpskin.agenda,代码行数:18,代码来源:test_views.py


注:本文中的plone.app.event.dx.behaviors.IEventBasic.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。