本文整理匯總了Python中openspending.model.account.Account.twitter_handle方法的典型用法代碼示例。如果您正苦於以下問題:Python Account.twitter_handle方法的具體用法?Python Account.twitter_handle怎麽用?Python Account.twitter_handle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openspending.model.account.Account
的用法示例。
在下文中一共展示了Account.twitter_handle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: make_account
# 需要導入模塊: from openspending.model.account import Account [as 別名]
# 或者: from openspending.model.account.Account import twitter_handle [as 別名]
def make_account(name='test', fullname='Test User',
email='[email protected]', twitter='testuser',
admin=False):
from openspending.model.account import Account
# First see if the account already exists and if so, return it
account = Account.by_name(name)
if account:
return account
# Account didn't exist so we create it and return it
account = Account()
account.name = name
account.fullname = fullname
account.email = email
account.twitter_handle = twitter
account.admin = admin
db.session.add(account)
db.session.commit()
return account