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