📜  自定义 django rest api 视图 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.455000             🧑  作者: Mango

代码示例1
def update(self, request, *args, **kwargs):
    data = request.DATA
    qs = Student_academic_program.objects.filter(student=2773951)
    serializer = StudentAcademicProgramSerializer(qs, data=data, many=True)

    if serializer.is_valid():
        serializer.save()

        return Response(serializer.data)

    ...