本文整理匯總了Python中openspending.model.account.Account.by_id方法的典型用法代碼示例。如果您正苦於以下問題:Python Account.by_id方法的具體用法?Python Account.by_id怎麽用?Python Account.by_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openspending.model.account.Account
的用法示例。
在下文中一共展示了Account.by_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: email_message
# 需要導入模塊: from openspending.model.account import Account [as 別名]
# 或者: from openspending.model.account.Account import by_id [as 別名]
def email_message():
user_id = request.args.get('id')
useraccount = Account.by_id(user_id)
if not useraccount:
message = "There is no user with this account"
return render_template('account/email_message.jade', message=message)
if useraccount.admin:
message = "This operation is not possible for this user type"
return render_template('account/email_message.jade', message=message)
message_dict = sendhash(useraccount, gettext=True)
message = str(message_dict) + "<br/><br/><a href='" + message_dict['verifylink'] + "'><h3>Click to Verify</h3></a>"
return render_template('account/email_message.jade', message=message)