Menu_list=((2, 'production and management), (1,' system management))
# all_menu_list=[]
# for the I in menu_list:
# menu_dict={}
# menu_dict [' menu_id]=[0] I
# menu_dict [' title ']=[1] I
# menu_dict [' children_id]=[]
# all_menu_list. Append (menu_dict)
#
Perssions_list=((11, 'user management', 1), (12, 'role management, 1), (13,' rights management ', 1), (14, 'other', 2))
# all_perssions_list=[]
# for the I in perssions_list:
# perssions_dict={}
# perssions_dict [' id ']=[0] I
# perssions_dict [' title ']=[1] I
# perssions_dict [' menu_id]=[2] I
# all_perssions_list. Append (perssions_dict)
#
# print (all_menu_list)
# print (all_perssions_list)
# how the following results are obtained by the above two tuple
Result=[
{" id ": 2, 'title' : 'production management', 'children_id: [14]},
{" id ": 1, the 'title' : 'system management', 'children_id: [11, 12, 13]}
]
Request a great god help, thank you!