def get_testsuit_project_format(datas): for item in datas: get_data(item) create_time_list = item['update_time'].split('T') first_part = create_time_list[0] second_part = create_time_list[1].split('.')[0] item['update_time'] = first_part + ' ' + second_part return datas
def retrieve(self, request, *args, **kwargs): report = self.get_object() serializer = self.get_serializer(instance=report) datas = get_data(serializer.data) try: datas['summary'] = json.loads(datas['summary'], encoding='utf-8') except Exception as e: pass return Response(datas)
def get_interface_list_format(datas): for item in datas: item = get_data(item) interface_id = item['id'] testcases = Testcases.objects.filter(interface_id=interface_id).count() configures = Configures.objects.filter(interface_id=interface_id).count() item['testcases'] = testcases item['configures'] = configures return datas
def get_envs_list_format(datas): for item in datas: get_data(item) return datas
def retrieve(self, request, *args, **kwargs): instance = self.get_object() serializer = self.get_serializer(instance) data = get_data(serializer.data) return Response(data)
def retrieve(self, request, *args, **kwargs): response = super().retrieve(request, *args, **kwargs) response.data = get_data(response.data) return response
def get_reports_format(datas): for item in datas: get_data(item) return datas