本文整理汇总了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
示例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
示例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
示例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_)
示例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