MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / update_resource_mapping_by_tool

Function update_resource_mapping_by_tool

apps/tools/serializers/tool_workflow.py:467–477  ·  view source on GitHub ↗
(tool_id: str, other_resource_mapping=None)

Source from the content-addressed store, hash-verified

465
466
467def update_resource_mapping_by_tool(tool_id: str, other_resource_mapping=None):
468 from application.flow.tools import get_instance_resource, save_workflow_mapping
469 from system_manage.models.resource_mapping import ResourceType
470
471 if other_resource_mapping is None:
472 other_resource_mapping = []
473 tool = QuerySet(ToolWorkflow).filter(tool_id=tool_id).first()
474 instance_mapping = get_instance_resource(tool, ResourceType.TOOL, str(tool_id), {})
475 save_workflow_mapping(tool.work_flow, ResourceType.TOOL, str(tool_id), instance_mapping + other_resource_mapping)
476
477 return

Callers 1

editMethod · 0.85

Calls 2

get_instance_resourceFunction · 0.90
save_workflow_mappingFunction · 0.90

Tested by

no test coverage detected