當前位置: 首頁>>代碼示例>>Python>>正文


Python Dependency.create_get_data_entities_params方法代碼示例

本文整理匯總了Python中common.utilities.inversion_of_control.Dependency.create_get_data_entities_params方法的典型用法代碼示例。如果您正苦於以下問題:Python Dependency.create_get_data_entities_params方法的具體用法?Python Dependency.create_get_data_entities_params怎麽用?Python Dependency.create_get_data_entities_params使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在common.utilities.inversion_of_control.Dependency的用法示例。


在下文中一共展示了Dependency.create_get_data_entities_params方法的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 create_get_data_entities_params [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"])
開發者ID:erezrubinstein,項目名稱:aa,代碼行數:13,代碼來源:data_access_misc_queries.py

示例2: delete_competitive_stores

# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import create_get_data_entities_params [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")
開發者ID:erezrubinstein,項目名稱:aa,代碼行數:19,代碼來源:data_access_misc_queries.py

示例3: delete_test_competitors

# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import create_get_data_entities_params [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")
開發者ID:erezrubinstein,項目名稱:aa,代碼行數:21,代碼來源:data_access_misc_queries.py


注:本文中的common.utilities.inversion_of_control.Dependency.create_get_data_entities_params方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。