當前位置: 首頁>>代碼示例>>Python>>正文


Python Contribution.find_one方法代碼示例

本文整理匯總了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)
開發者ID:belokop,項目名稱:indico_bare,代碼行數:30,代碼來源:event_paper_reviewing.py

示例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)
開發者ID:indico,項目名稱:indico,代碼行數:5,代碼來源:management.py


注:本文中的indico.modules.events.contributions.models.contributions.Contribution.find_one方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。