|
@@ -19,7 +19,7 @@ class SchoolDeptViews(APIView):
|
|
resData = SchoolDept.objects.filter(parent_id=parentId).annotate(childer=F('rght') - F('lft') - 1).values('id',
|
|
resData = SchoolDept.objects.filter(parent_id=parentId).annotate(childer=F('rght') - F('lft') - 1).values('id',
|
|
'name',
|
|
'name',
|
|
'remark',
|
|
'remark',
|
|
- 'childer').all()
|
|
|
|
|
|
+ 'childer','parent_id').all()
|
|
for res in resData:
|
|
for res in resData:
|
|
res['childer'] = res['childer'] // 2 != 0
|
|
res['childer'] = res['childer'] // 2 != 0
|
|
return Response(data=resData, status=status.HTTP_200_OK)
|
|
return Response(data=resData, status=status.HTTP_200_OK)
|