本文整理汇总了Python中indico.modules.events.contributions.models.contributions.Contribution.find_one方法的典型用法代码示例。如果您正苦于以下问题:Python Contribution.find_one方法的具体用法?Python Contribution.find_one怎么用?Python Contribution.find_one使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.events.contributions.models.contributions.Contribution
的用法示例。
在下文中一共展示了Contribution.find_one方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _migrate_event_reviewing
# 需要导入模块: from indico.modules.events.contributions.models.contributions import Contribution [as 别名]
# 或者: from indico.modules.events.contributions.models.contributions.Contribution import find_one [as 别名]
def _migrate_event_reviewing(self, conf):
conference_settings = getattr(conf, '_confPaperReview', None)
if not conference_settings:
return
event = conf.as_event
contrib_index = conference_settings._contribution_index = IOBTree()
contrib_reviewers = _invert_mapping(conference_settings._reviewerContribution)
contrib_referees = _invert_mapping(conference_settings._refereeContribution)
contrib_editors = _invert_mapping(conference_settings._editorContribution)
for old_contribution in conf.contributions.itervalues():
review_manager = getattr(old_contribution, '_reviewManager', None)
new_contribution = Contribution.find_one(event_id=event.id, friendly_id=int(old_contribution.id))
cid = int(new_contribution.id)
if review_manager:
review_manager._contrib_id = cid
contrib_index[cid] = review_manager
self._migrate_contribution_roles(old_contribution, new_contribution, contrib_reviewers,
PaperReviewingRoleType.reviewer, event.id)
self._migrate_contribution_roles(old_contribution, new_contribution, contrib_referees,
PaperReviewingRoleType.referee, event.id)
self._migrate_contribution_roles(old_contribution, new_contribution, contrib_editors,
PaperReviewingRoleType.editor, event.id)
self._migrate_reviewing_materials(old_contribution, new_contribution, review_manager, event.id)
示例2: _process_args
# 需要导入模块: from indico.modules.events.contributions.models.contributions import Contribution [as 别名]
# 或者: from indico.modules.events.contributions.models.contributions.Contribution import find_one [as 别名]
def _process_args(self):
RHManageContributionsBase._process_args(self)
self.contrib = Contribution.find_one(id=request.view_args['contrib_id'], is_deleted=False)