本文整理汇总了Python中indico.modules.events.agreements.models.agreements.Agreement.get_one方法的典型用法代码示例。如果您正苦于以下问题:Python Agreement.get_one方法的具体用法?Python Agreement.get_one怎么用?Python Agreement.get_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.events.agreements.models.agreements.Agreement
的用法示例。
在下文中一共展示了Agreement.get_one方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process_args
# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import get_one [as 别名]
def _process_args(self):
RHAgreementManagerDetails._process_args(self)
if 'id' in request.view_args:
self.agreement = Agreement.get_one(request.view_args['id'])
if self.event != 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.event)[identifier]
except KeyError:
raise NotFound
示例2: _checkParams
# 需要导入模块: from indico.modules.events.agreements.models.agreements import Agreement [as 别名]
# 或者: from indico.modules.events.agreements.models.agreements.Agreement import get_one [as 别名]
def _checkParams(self, params):
RHConferenceBaseDisplay._checkParams(self, params)
self.agreement = Agreement.get_one(request.view_args['id'])
if self.agreement.is_orphan():
raise NotFound('The agreement is not active anymore')