当前位置: 首页>>代码示例>>Python>>正文


Python Agreement.find_one方法代码示例

本文整理汇总了Python中indico.modules.events.agreements.models.agreements.Agreement.find_one方法的典型用法代码示例。如果您正苦于以下问题:Python Agreement.find_one方法的具体用法?Python Agreement.find_one怎么用?Python Agreement.find_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在indico.modules.events.agreements.models.agreements.Agreement的用法示例。


在下文中一共展示了Agreement.find_one方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _checkParams

# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import find_one [as 别名]
 def _checkParams(self, params):
     RHAgreementManagerDetails._checkParams(self, params)
     if 'id' in request.view_args:
         self.agreement = Agreement.find_one(id=request.view_args['id'])
         if self._conf != self.agreement.event:
             raise NotFound
         if not self.agreement.pending:
             raise NoReportError(_("The agreement is already signed"))
     else:
         self.agreement = None
         identifier = request.args['identifier']
         try:
             self.person = self.definition.get_people(self._conf)[identifier]
         except KeyError:
             raise NotFound
开发者ID:,项目名称:,代码行数:17,代码来源:

示例2: test_signed_on_behalf

# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import find_one [as 别名]
def test_signed_on_behalf(dummy_agreement, state, expected):
    dummy_agreement.state = state
    assert dummy_agreement.signed_on_behalf == expected
    assert Agreement.find_one(signed_on_behalf=expected) == dummy_agreement
开发者ID:k3njiy,项目名称:indico,代码行数:6,代码来源:agreements_test.py

示例3: test_rejected

# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import find_one [as 别名]
def test_rejected(dummy_agreement, state, expected):
    dummy_agreement.state = state
    assert dummy_agreement.rejected == expected
    assert Agreement.find_one(rejected=expected) == dummy_agreement
开发者ID:k3njiy,项目名称:indico,代码行数:6,代码来源:agreements_test.py

示例4: test_pending

# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import find_one [as 别名]
def test_pending(dummy_agreement, state, expected):
    dummy_agreement.state = state
    filter_ = Agreement.pending if expected else ~Agreement.pending
    assert dummy_agreement.pending == expected
    assert Agreement.find_one(filter_) == dummy_agreement
    assert not Agreement.find_first(~filter_)
开发者ID:k3njiy,项目名称:indico,代码行数:8,代码来源:agreements_test.py

示例5: test_accepted

# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import find_one [as 别名]
def test_accepted(dummy_agreement, state, expected):
    dummy_agreement.state = state
    assert dummy_agreement.accepted == expected
    assert Agreement.find_one(accepted=expected) == dummy_agreement
开发者ID:k3njiy,项目名称:indico,代码行数:6,代码来源:agreements_test.py


注:本文中的indico.modules.events.agreements.models.agreements.Agreement.find_one方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。