|
@@ -84,7 +84,7 @@ class DataDictView(View):
|
|
|
item_list = []
|
|
|
for item in items:
|
|
|
item_i18n_name = (
|
|
|
- list(category.translations.values("lang_code", "name"))
|
|
|
+ list(item.translations.values("lang_code", "name"))
|
|
|
or []
|
|
|
)
|
|
|
item_list.append({
|
|
@@ -97,7 +97,7 @@ class DataDictView(View):
|
|
|
"createdBy": item.created_by,
|
|
|
"updatedTime": item.updated_time,
|
|
|
"updatedBy": item.updated_by,
|
|
|
- "name": item_i18n_name
|
|
|
+ "itemNames": item_i18n_name
|
|
|
})
|
|
|
|
|
|
result.append({
|
|
@@ -111,7 +111,7 @@ class DataDictView(View):
|
|
|
"createdBy": category.created_by,
|
|
|
"updatedTime": category.updated_time,
|
|
|
"updatedBy": category.updated_by,
|
|
|
- "name": i18n_name,
|
|
|
+ "names": i18n_name,
|
|
|
"items": item_list
|
|
|
})
|
|
|
|
|
@@ -121,7 +121,7 @@ class DataDictView(View):
|
|
|
})
|
|
|
|
|
|
except Exception as e:
|
|
|
- return response.json(500, msg=f"查询失败: {str(e)}")
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@staticmethod
|
|
|
def get_dict_category(request_dict, response):
|
|
@@ -173,7 +173,7 @@ class DataDictView(View):
|
|
|
return response.json(0, result_list)
|
|
|
|
|
|
except Exception as e:
|
|
|
- return response.json(500, msg=f"查询失败: {str(e)}")
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
@@ -247,7 +247,7 @@ class DataDictView(View):
|
|
|
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
- return response.json(500, f'添加失败: {str(e)}')
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
@@ -326,7 +326,7 @@ class DataDictView(View):
|
|
|
return response.json(0)
|
|
|
|
|
|
except Exception as e:
|
|
|
- return response.json(500, f"编辑失败: {str(e)}")
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
@@ -354,4 +354,4 @@ class DataDictView(View):
|
|
|
return response.json(0)
|
|
|
|
|
|
except Exception as e:
|
|
|
- return response.json(500, f"删除失败: {str(e)}")
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|