作者 wanweibin

update

@@ -59,17 +59,12 @@ class ProjectDetail(RetrieveAPIView): @@ -59,17 +59,12 @@ class ProjectDetail(RetrieveAPIView):
59 auditors = Auditor.objects.all() 59 auditors = Auditor.objects.all()
60 # result = Result.objects.filter(project=obj) 60 # result = Result.objects.filter(project=obj)
61 for i in auditors: 61 for i in auditors:
  62 + res = i.result_auditor.filter(project=obj).values('is_accept', 'memo').first()
62 obj.result.append({ 63 obj.result.append({
63 "auditor": i.user.username, 64 "auditor": i.user.username,
64 - "is_accept": i.result_auditor.filter(project=obj).values_list('is_accept', flat=True).first() 65 + "is_accept": res['is_accept'],
  66 + "memo": res['memo'],
65 }) 67 })
66 - # auditor_len = Result.objects.filter(project=obj).count()  
67 - # if auditor_len == 2:  
68 - # obj.cur_auditor = "已完结"  
69 - # elif auditor_len == 1:  
70 - # obj.cur_auditor = AUDITORS[1][1]  
71 - # else:  
72 - # obj.cur_auditor = AUDITORS[0][1]  
73 return response(ProjectSerializer(obj).data) 68 return response(ProjectSerializer(obj).data)
74 69
75 70