本文整理汇总了Python中plone.app.event.dx.behaviors.IEventBasic.end方法的典型用法代码示例。如果您正苦于以下问题:Python IEventBasic.end方法的具体用法?Python IEventBasic.end怎么用?Python IEventBasic.end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.event.dx.behaviors.IEventBasic
的用法示例。
在下文中一共展示了IEventBasic.end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_phone_or_cellphone
# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import end [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')
示例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 end [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())
示例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 end [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
)
示例4: set_event_fields
# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import end [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'
示例5: test_event_view_without_behavior
# 需要导入模块: from plone.app.event.dx.behaviors import IEventBasic [as 别名]
# 或者: from plone.app.event.dx.behaviors.IEventBasic import end [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())