本文整理汇总了Python中openspending.model.account.Account.verified方法的典型用法代码示例。如果您正苦于以下问题:Python Account.verified方法的具体用法?Python Account.verified怎么用?Python Account.verified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openspending.model.account.Account
的用法示例。
在下文中一共展示了Account.verified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_account
# 需要导入模块: from openspending.model.account import Account [as 别名]
# 或者: from openspending.model.account.Account import verified [as 别名]
def make_account(name='test', fullname='Test User',
email='[email protected]',
admin=False, verified=True):
from openspending.model.account import Account
# First see if the account already exists and if so, return it
account = Account.by_email(email)
if account:
return account
# Account didn't exist so we create it and return it
account = Account()
account.fullname = fullname
account.email = email
account.admin = admin
account.verified = verified
db.session.add(account)
db.session.commit()
return account