本文整理匯總了Python中gratipay.models.account_elsewhere.AccountElsewhere.upsert方法的典型用法代碼示例。如果您正苦於以下問題:Python AccountElsewhere.upsert方法的具體用法?Python AccountElsewhere.upsert怎麽用?Python AccountElsewhere.upsert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gratipay.models.account_elsewhere.AccountElsewhere
的用法示例。
在下文中一共展示了AccountElsewhere.upsert方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: make_elsewhere
# 需要導入模塊: from gratipay.models.account_elsewhere import AccountElsewhere [as 別名]
# 或者: from gratipay.models.account_elsewhere.AccountElsewhere import upsert [as 別名]
def make_elsewhere(self, platform, user_id, user_name, **kw):
info = UserInfo( platform=platform
, user_id=unicode(user_id)
, user_name=user_name
, **kw
)
return AccountElsewhere.upsert(info)
示例2: make_elsewhere
# 需要導入模塊: from gratipay.models.account_elsewhere import AccountElsewhere [as 別名]
# 或者: from gratipay.models.account_elsewhere.AccountElsewhere import upsert [as 別名]
def make_elsewhere(self, platform, user_id, user_name, **kw):
"""Factory for :py:class:`~gratipay.models.account_elsewhere.AccountElsewhere`.
"""
info = UserInfo( platform=platform
, user_id=unicode(user_id)
, user_name=user_name
, **kw
)
return AccountElsewhere.upsert(info)
示例3: make_elsewhere
# 需要導入模塊: from gratipay.models.account_elsewhere import AccountElsewhere [as 別名]
# 或者: from gratipay.models.account_elsewhere.AccountElsewhere import upsert [as 別名]
def make_elsewhere(self, platform, user_id, user_name, is_locked=False, **kw):
info = UserInfo( platform=platform
, user_id=unicode(user_id)
, user_name=user_name
, **kw
)
account = AccountElsewhere.upsert(info)
if is_locked:
account.set_is_locked(True)
return account
示例4: test_upsert
# 需要導入模塊: from gratipay.models.account_elsewhere import AccountElsewhere [as 別名]
# 或者: from gratipay.models.account_elsewhere.AccountElsewhere import upsert [as 別名]
def test_upsert(self):
for platform in self.platforms:
user_info = getattr(user_info_examples, platform.name)()
account = AccountElsewhere.upsert(platform.extract_user_info(user_info))
assert isinstance(account, AccountElsewhere)
示例5: test_github_get_friends_for
# 需要導入模塊: from gratipay.models.account_elsewhere import AccountElsewhere [as 別名]
# 或者: from gratipay.models.account_elsewhere.AccountElsewhere import upsert [as 別名]
def test_github_get_friends_for(self):
platform = self.platforms.github
user_info = platform.extract_user_info(user_info_examples.github())
account = AccountElsewhere.upsert(user_info)
friends, nfriends, pages_urls = platform.get_friends_for(account)
assert nfriends > 0