本文整理匯總了Python中common.utilities.inversion_of_control.Dependency.call_get_data_entities_linked_from方法的典型用法代碼示例。如果您正苦於以下問題:Python Dependency.call_get_data_entities_linked_from方法的具體用法?Python Dependency.call_get_data_entities_linked_from怎麽用?Python Dependency.call_get_data_entities_linked_from使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common.utilities.inversion_of_control.Dependency
的用法示例。
在下文中一共展示了Dependency.call_get_data_entities_linked_from方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: select_count_trade_area_by_store
# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import call_get_data_entities_linked_from [as 別名]
def select_count_trade_area_by_store(store_id):
# get dependencies
core_api_provider = Dependency("CoreAPIProvider").value
param_builder = Dependency("CoreAPIParamsBuilder").value
# create params
filters = { "link.relation_type": "store_trade_area" }
params = param_builder.create_get_data_entities_params(field_filters = filters)["params"]
# run query and return first id
return len(core_api_provider.call_get_data_entities_linked_from("trade_area", "store", store_id, params)["rows"])
示例2: delete_competitive_stores
# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import call_get_data_entities_linked_from [as 別名]
def delete_competitive_stores(trade_area_id):
# get dependency
core_api_provider = Dependency("CoreAPIProvider").value
param_builder = Dependency("CoreAPIParamsBuilder").value
# create params
filters = { "link.relation_type": "store_trade_area_competition" }
params = param_builder.create_get_data_entities_params(field_filters = filters)["params"]
# get links and store_ids
links = core_api_provider.call_get_data_entities_linked_from("store", "trade_area", trade_area_id, params)["rows"]
# for each store, delete link
for link in links:
# bomboj for
core_api_provider.mds.call_del_link_without_id("store", link["to._id"], "away_store", "trade_area", trade_area_id, "trade_area", "store_trade_area_competition")
示例3: delete_test_competitors
# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import call_get_data_entities_linked_from [as 別名]
def delete_test_competitors(company_id):
# get dependency
core_api_provider = Dependency("CoreAPIProvider").value
param_builder = Dependency("CoreAPIParamsBuilder").value
# create params
filters = {
"link.relation_type": "company_competition"
}
params = param_builder.create_get_data_entities_params(field_filters = filters)["params"]
# get links
links = core_api_provider.call_get_data_entities_linked_from("company", "company", company_id, params)["rows"]
# delete links
for link in links:
# bomboj for
core_api_provider.mds.call_del_link_without_id("company", company_id, "competitor", "company", link["to._id"], "competitor", "company_competition")