|
@@ -235,13 +235,17 @@ class ApplicationView(View):
|
|
|
if line == 0:
|
|
|
line=10
|
|
|
qs = ApplicationModel.objects.all()
|
|
|
- gc = GrantCodeModel.objects.all()
|
|
|
+
|
|
|
if qs.exists():
|
|
|
count = qs.count()
|
|
|
res = qs[(page - 1) * line:page * line]
|
|
|
send_json = CommonService.qs_to_dict(res)
|
|
|
+ for k, v in enumerate(send_json["datas"]):
|
|
|
+ print(send_json['datas'][k]['pk'])
|
|
|
+ gc = GrantCodeModel.objects.filter(application = send_json['datas'][k]['pk'])
|
|
|
+ send_json["datas"][k]['fields']['count_num'] = gc.count()
|
|
|
send_json['count'] = count
|
|
|
- send_json['gc_count'] = gc.count()
|
|
|
+
|
|
|
return response.json(0, send_json)
|
|
|
else:
|
|
|
return response.json(0, {'datas': [], 'count': 0})
|