本文整理汇总了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