当前位置: 首页>>代码示例>>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;未经允许,请勿转载。