MCPcopy Index your code
hub / github.com/diffgram/diffgram / query_suggest_web

Function query_suggest_web

default/methods/query_engine/query_suggest.py:11–56  ·  view source on GitHub ↗

List all the discussion based on the given filters. We can filter by job_id, task_id, file_id, status and project. :param project_string_id: :return:

(project_string_id)

Source from the content-addressed store, hash-verified

9@routes.route('/api/v1/project/<string:project_string_id>/query-suggest', methods = ['POST'])
10@Project_permissions.user_has_project(Roles = ["admin", "Editor", "allow_if_project_is_public"], apis_user_list = ["api_enabled_builder"])
11def query_suggest_web(project_string_id):
12 """
13 List all the discussion based on the given filters.
14 We can filter by job_id, task_id, file_id, status and project.
15 :param project_string_id:
16 :return:
17 """
18 issue_list_spec_list = [
19 {"query": {
20 'kind': str,
21 "required": True,
22 "string_len_not_zero": False
23 }},
24 ]
25
26 log, input, untrusted_input = regular_input.master(
27 request = request,
28 spec_list = issue_list_spec_list,
29 string_len_not_zero = False)
30 if len(log["error"].keys()) >= 1:
31 return jsonify(log = log), 400
32
33 with sessionMaker.session_scope() as session:
34
35 project = Project.get_by_string_id(session, project_string_id)
36 user = User.get(session)
37 member = None
38 if user:
39 member = user.member
40 else:
41 if request.authorization:
42 client_id = request.authorization.get('username', None)
43 auth = Auth_api.get(session, client_id)
44 member = auth.member
45
46 query_data, log = query_suggest_core(
47 session = session,
48 log = log,
49 project = project,
50 query = input['query'],
51 member = member,
52 )
53 if len(log["error"].keys()) >= 1:
54 return jsonify(log = log), 400
55
56 return jsonify(query_data), 200
57
58
59def query_suggest_core(session: object,

Callers

nothing calls this directly

Calls 3

query_suggest_coreFunction · 0.85
get_by_string_idMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected