|
|
@ -40,14 +40,14 @@ def custom_rate_limit(limit, seconds): |
|
|
|
|
|
|
|
|
|
|
|
def get_parent_map(input_list, parameter): |
|
|
|
parentChildMap = {} |
|
|
|
parent_child_map = {} |
|
|
|
for b in input_list: |
|
|
|
parentChildMap.setdefault(b[parameter] or None, []).append(b) |
|
|
|
parent_child_map.setdefault(b[parameter] or None, []).append(b) |
|
|
|
list1 = [] |
|
|
|
for p in parentChildMap: |
|
|
|
da = {"procedure_name": p, 'steps': parentChildMap[p]} |
|
|
|
for p in parent_child_map: |
|
|
|
da = {"procedure_name": p, 'steps': parent_child_map[p]} |
|
|
|
list1.append(da) |
|
|
|
for i in parentChildMap[p]: |
|
|
|
for i in parent_child_map[p]: |
|
|
|
del i['procedure_name'] |
|
|
|
del i['idx'] |
|
|
|
return list1 |
|
|
@ -211,7 +211,8 @@ def json_grouping(args, language): |
|
|
|
# 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, |
|
|
|
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, |
|
|
|
case when content_type='Link' Then system_id else content end as 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) |
|
|
|
|
|
|
@ -863,7 +864,10 @@ def upv(): |
|
|
|
# frappe.db.commit() |
|
|
|
return 1 |
|
|
|
|
|
|
|
|
|
|
|
""" Generate publish """ |
|
|
|
|
|
|
|
|
|
|
|
@frappe.whitelist() |
|
|
|
def run_publish(): |
|
|
|
new_publish('THAR-en -2023-05-21 16:57:54.119826', |
|
|
|