本文整理汇总了Python中indico.modules.oauth.models.applications.OAuthApplication.find方法的典型用法代码示例。如果您正苦于以下问题:Python OAuthApplication.find方法的具体用法?Python OAuthApplication.find怎么用?Python OAuthApplication.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.oauth.models.applications.OAuthApplication
的用法示例。
在下文中一共展示了OAuthApplication.find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process
# 需要导入模块: from indico.modules.oauth.models.applications import OAuthApplication [as 别名]
# 或者: from indico.modules.oauth.models.applications.OAuthApplication import find [as 别名]
def _process(self):
applications = OAuthApplication.find().order_by(db.func.lower(OAuthApplication.name)).all()
return WPOAuthAdmin.render_template('apps.html', applications=applications)
示例2: test_save_token_no_application
# 需要导入模块: from indico.modules.oauth.models.applications import OAuthApplication [as 别名]
# 或者: from indico.modules.oauth.models.applications.OAuthApplication import find [as 别名]
def test_save_token_no_application(dummy_application, dummy_request, token_data):
dummy_request.client.client_id = unicode(uuid4())
assert not OAuthApplication.find(client_id=dummy_request.client.client_id).count()
with pytest.raises(NoResultFound):
save_token(token_data, dummy_request)
示例3: validate_name
# 需要导入模块: from indico.modules.oauth.models.applications import OAuthApplication [as 别名]
# 或者: from indico.modules.oauth.models.applications.OAuthApplication import find [as 别名]
def validate_name(self, field):
query = OAuthApplication.find(name=field.data)
if self.application:
query = query.filter(db.func.lower(OAuthApplication.name) != self.application.name.lower())
if query.count():
raise ValidationError(_("There is already an application with this name"))