本文整理匯總了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)