|
@@ -103,6 +103,7 @@ class DeptAndJobView(ModelViewSet):
|
|
|
|
|
|
'''
|
|
'''
|
|
根据部门id获取部门岗位中间表的该部门所有岗位信息
|
|
根据部门id获取部门岗位中间表的该部门所有岗位信息
|
|
|
|
+ 返回中间表id和岗位name
|
|
'''
|
|
'''
|
|
|
|
|
|
def list(self, request, *args, **kwargs):
|
|
def list(self, request, *args, **kwargs):
|
|
@@ -111,5 +112,8 @@ class DeptAndJobView(ModelViewSet):
|
|
deptAndJob = Dept_job.objects.filter(dept_id=deptId).all()
|
|
deptAndJob = Dept_job.objects.filter(dept_id=deptId).all()
|
|
data = []
|
|
data = []
|
|
for DJ in deptAndJob:
|
|
for DJ in deptAndJob:
|
|
- data.append(model_to_dict(DJ.job))
|
|
|
|
|
|
+ data.append({
|
|
|
|
+ 'id': DJ.id,
|
|
|
|
+ 'name': DJ.job.name
|
|
|
|
+ })
|
|
return Response(data=data, status=status.HTTP_200_OK)
|
|
return Response(data=data, status=status.HTTP_200_OK)
|