本文整理汇总了Python中plone.event.interfaces.IEventAccessor.update方法的典型用法代码示例。如果您正苦于以下问题:Python IEventAccessor.update方法的具体用法?Python IEventAccessor.update怎么用?Python IEventAccessor.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.event.interfaces.IEventAccessor
的用法示例。
在下文中一共展示了IEventAccessor.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateObject
# 需要导入模块: from plone.event.interfaces import IEventAccessor [as 别名]
# 或者: from plone.event.interfaces.IEventAccessor import update [as 别名]
def updateObject(self, context, v):
# Get the accessor object
acc = IEventAccessor(context)
# Establish the input arguments
kwargs = self.getRequestDataAsArguments(v)
# Pass the arguments into the object
acc.edit(**kwargs)
# Update any arguments that are not part of the default event schema
acc.update(**kwargs)
# Update complex fields (text, event agenda)
self.updateComplexFields(acc.context, v)
# Reindex the object
acc.context.reindexObject()
# Ref: http://docs.plone.org/external/plone.app.event/docs/development.html#accessing-event-objects-via-an-unified-accessor-object
# Throw ObjectModifiedEvent after setting properties to call an event subscriber which does some timezone related post calculations
notify(ObjectModifiedEvent(acc.context))
# Return object that was updated
return acc.context
示例2: importContent
# 需要导入模块: from plone.event.interfaces import IEventAccessor [as 别名]
# 或者: from plone.event.interfaces.IEventAccessor import update [as 别名]
def importContent(self):
# Create new content importer object
v = AtlasProductImporter(uid=self.uid, domain=self.domain)
# Additional fields
kwargs = {}
# Add a Webinar Group
webinar_group = self.addWebinarGroup(self.import_path, v, **kwargs)
# Add the Webinar
webinar = self.addWebinar(webinar_group, v,
**kwargs)
# Set the webinar start/end dates to publish date of imported object
webinar_date_start = v.data.start
webinar_date_start = DateTime(webinar_date_start).asdatetime()
webinar_date_end = v.data.end
webinar_date_end = DateTime(webinar_date_end).asdatetime()
acc = IEventAccessor(webinar)
acc.edit(start=webinar_date_start, end=webinar_date_end)
acc.update(start=webinar_date_start, end=webinar_date_end)
# Initialize webinar_url variable
webinar_url = v.data.event_url
# If we have a 'webinar_url', set that on the Webinar Product
if webinar_url:
acc.edit(webinar_url=webinar_url)
acc.update(webinar_url=webinar_url)
# Finalize items
self.finalize(webinar)
self.finalize(webinar_group)
# Return JSON output
return self.getJSON(webinar_group)