本文整理汇总了Python中indico.modules.events.Event.get_one方法的典型用法代码示例。如果您正苦于以下问题:Python Event.get_one方法的具体用法?Python Event.get_one怎么用?Python Event.get_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.events.Event
的用法示例。
在下文中一共展示了Event.get_one方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process_args
# 需要导入模块: from indico.modules.events import Event [as 别名]
# 或者: from indico.modules.events.Event import get_one [as 别名]
def _process_args(self):
if 'confId' in request.view_args:
self.obj = Event.get_one(request.view_args['confId'], is_deleted=False)
self.obj_type = 'event'
elif 'category_id' in request.view_args:
self.obj = Category.get_one(request.view_args['category_id'], is_deleted=False)
self.obj_type = 'category' if not self.obj.is_root else None
else:
self.obj = Category.get_root()
self.obj_type = None
示例2: obj_deref
# 需要导入模块: from indico.modules.events import Event [as 别名]
# 或者: from indico.modules.events.Event import get_one [as 别名]
def obj_deref(ref):
"""Returns the object identified by `ref`"""
from indico_livesync.models.queue import EntryType
if ref['type'] == EntryType.category:
return Category.get_one(ref['category_id'])
elif ref['type'] == EntryType.event:
return Event.get_one(ref['event_id'])
elif ref['type'] == EntryType.session:
return Session.get_one(ref['session_id'])
elif ref['type'] == EntryType.contribution:
return Contribution.get_one(ref['contrib_id'])
elif ref['type'] == EntryType.subcontribution:
return SubContribution.get_one(ref['subcontrib_id'])
else:
raise ValueError('Unexpected object type: {}'.format(ref['type']))
示例3: event
# 需要导入模块: from indico.modules.events import Event [as 别名]
# 或者: from indico.modules.events.Event import get_one [as 别名]
def event(self):
return Event.get_one(self.event_id, is_deleted=False)
示例4: _build_report
# 需要导入模块: from indico.modules.events import Event [as 别名]
# 或者: from indico.modules.events.Event import get_one [as 别名]
def _build_report(self):
event = Event.get_one(self.params['event_id'], is_deleted=False)
new_material = get_nested_attached_items(event)
self.material = {'tree': [self._format_data(new_material)]}