Browse Source

'新增树控件get返回值多一个父id,修复没有父id无法更新的bug'

DYaiu 4 years ago
parent
commit
d076da9ee8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      workTtree/views.py

+ 1 - 1
workTtree/views.py

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