本文整理汇总了Python中indico.modules.events.models.events.Event.get方法的典型用法代码示例。如果您正苦于以下问题:Python Event.get方法的具体用法?Python Event.get怎么用?Python Event.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.events.models.events.Event
的用法示例。
在下文中一共展示了Event.get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: migrate_layout_settings
# 需要导入模块: from indico.modules.events.models.events import Event [as 别名]
# 或者: from indico.modules.events.models.events.Event import get [as 别名]
def migrate_layout_settings(self):
print cformat('%{white!}migrating layout settings, event logos and custom stylesheets')
default_styles = self.zodb_root['MaKaCInfo']['main']._styleMgr._defaultEventStylesheet
for event, event_type, dmgr, logo, custom_css in committing_iterator(self._iter_event_layout_data()):
if event_type != 'conference':
theme = dmgr._defaultstyle
if not theme or theme == default_styles[event_type]:
continue
layout_settings.set(event, 'timetable_theme', theme)
if not self.quiet:
self.print_success(cformat('- %{cyan}Default timetable theme: {}').format(theme), event_id=event.id)
continue
settings = self._get_event_settings(event, dmgr)
layout_settings.set_multi(event, settings)
if not self.quiet:
self.print_success(cformat('- %{cyan}Layout settings'), event_id=event.id)
if logo or custom_css:
sa_event = Event.get(event.id)
if not sa_event:
self.print_warning('Event does not exist (anymore)! Logo and/or CSS file not saved!',
event_id=event.id)
continue
if logo:
self._process_logo(logo, sa_event)
if custom_css:
self._process_css(custom_css, sa_event)