|
|
@ -35,6 +35,7 @@ def custom_rate_limit(limit, seconds): |
|
|
|
return "You hit the rate limit because of too many requests. Please try after sometime." |
|
|
|
return 1 |
|
|
|
|
|
|
|
|
|
|
|
def get_parent_map(input_list, parameter): |
|
|
|
parentChildMap = {} |
|
|
|
for b in input_list: |
|
|
@ -203,14 +204,14 @@ def json_grouping(args, language): |
|
|
|
for k in docs_child: |
|
|
|
if k['variant_mapping'] == d and k['system'] == i and k['sub_system'] == j: |
|
|
|
# proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(case when content_type='Link' Then system_id else content end) as content, |
|
|
|
# GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details |
|
|
|
# GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details |
|
|
|
# where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format( |
|
|
|
# current_db_name, k['procedure_link']), as_dict=True) |
|
|
|
|
|
|
|
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, content, |
|
|
|
file,idx as display_order,idx from {}.tabProcedure_Details |
|
|
|
where parent ='{}' order by idx asc; '''.format(current_db_name, k['procedure_link']), as_dict=True) |
|
|
|
|
|
|
|
|
|
|
|
proc_data = get_parent_map( |
|
|
|
proc_details, 'procedure_name') |
|
|
|
total_count += len(proc_data) |
|
|
|