本文整理汇总了Python中services.managers.eve_api_manager.EveApiManager.get_corporation_ticker_from_id方法的典型用法代码示例。如果您正苦于以下问题:Python EveApiManager.get_corporation_ticker_from_id方法的具体用法?Python EveApiManager.get_corporation_ticker_from_id怎么用?Python EveApiManager.get_corporation_ticker_from_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类services.managers.eve_api_manager.EveApiManager
的用法示例。
在下文中一共展示了EveApiManager.get_corporation_ticker_from_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_characters_from_list
# 需要导入模块: from services.managers.eve_api_manager import EveApiManager [as 别名]
# 或者: from services.managers.eve_api_manager.EveApiManager import get_corporation_ticker_from_id [as 别名]
def update_characters_from_list(chars):
for char in chars.result:
if EveManager.check_if_character_exist(chars.result[char]['name']):
eve_char = EveManager.get_character_by_character_name(chars.result[char]['name'])
eve_char.corporation_id = chars.result[char]['corp']['id']
eve_char.corporation_name = chars.result[char]['corp']['name']
eve_char.corporation_ticker = EveApiManager.get_corporation_ticker_from_id(
chars.result[char]['corp']['id'])
eve_char.alliance_id = chars.result[char]['alliance']['id']
eve_char.alliance_name = chars.result[char]['alliance']['name']
eve_char.save()
示例2: create_characters_from_list
# 需要导入模块: from services.managers.eve_api_manager import EveApiManager [as 别名]
# 或者: from services.managers.eve_api_manager.EveApiManager import get_corporation_ticker_from_id [as 别名]
def create_characters_from_list(chars, user, api_id):
for char in chars.result:
if not EveManager.check_if_character_exist(chars.result[char]['name']):
EveManager.create_character(chars.result[char]['id'],
chars.result[char]['name'],
chars.result[char]['corp']['id'],
chars.result[char]['corp']['name'],
EveApiManager.get_corporation_ticker_from_id(
chars.result[char]['corp']['id']),
chars.result[char]['alliance']['id'],
chars.result[char]['alliance']['name'],
user, api_id)
示例3: update_characters_from_list
# 需要导入模块: from services.managers.eve_api_manager import EveApiManager [as 别名]
# 或者: from services.managers.eve_api_manager.EveApiManager import get_corporation_ticker_from_id [as 别名]
def update_characters_from_list(chars):
logger.debug("Updating characters from list: %s" % chars.result)
for char in chars.result:
if EveManager.check_if_character_exist(chars.result[char]['name']):
eve_char = EveManager.get_character_by_character_name(chars.result[char]['name'])
logger.debug("Got existing character model %s" % eve_char)
eve_char.corporation_id = chars.result[char]['corp']['id']
eve_char.corporation_name = chars.result[char]['corp']['name']
eve_char.corporation_ticker = EveApiManager.get_corporation_ticker_from_id(
chars.result[char]['corp']['id'])
eve_char.alliance_id = chars.result[char]['alliance']['id']
eve_char.alliance_name = chars.result[char]['alliance']['name']
eve_char.save()
logger.info("Updated character model %s" % eve_char)
else:
logger.warn("Attempting to update non-existing character model with name %s" % chars.result[char]['name'])