本文整理汇总了Python中indico.modules.events.models.settings.EventSetting.set_multi方法的典型用法代码示例。如果您正苦于以下问题:Python EventSetting.set_multi方法的具体用法?Python EventSetting.set_multi怎么用?Python EventSetting.set_multi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.events.models.settings.EventSetting
的用法示例。
在下文中一共展示了EventSetting.set_multi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_multi
# 需要导入模块: from indico.modules.events.models.settings import EventSetting [as 别名]
# 或者: from indico.modules.events.models.settings.EventSetting import set_multi [as 别名]
def set_multi(self, event, items):
"""Sets multiple settings at once.
:param event: Event (or its ID)
:param items: Dict containing the new settings
"""
self._split_call(items,
lambda x: EventSetting.set_multi(self.module, x, event_id=event),
lambda x: EventSettingPrincipal.set_acl_multi(self.module, x, event_id=event))
self._flush_cache()
示例2: set_multi
# 需要导入模块: from indico.modules.events.models.settings import EventSetting [as 别名]
# 或者: from indico.modules.events.models.settings.EventSetting import set_multi [as 别名]
def set_multi(self, event, items):
"""Sets multiple settings at once.
:param event: Event (or its ID)
:param items: Dict containing the new settings
"""
items = {k: self._convert_from_python(k, v) for k, v in items.iteritems()}
self._split_call(items,
lambda x: EventSetting.set_multi(self.module, x, event_id=event),
lambda x: EventSettingPrincipal.set_acl_multi(self.module, x, event_id=event))
self._flush_cache()