MCPcopy Index your code
hub / github.com/codemistic/Web-Development / patch

Method patch

django_rest/core/home/views.py:80–93  ·  view source on GitHub ↗
(self,request)

Source from the content-addressed store, hash-verified

78
79
80 def patch(self,request):
81 try:
82 student_obj = Student.objects.get(id=request.data['id'])
83
84 serializer = StudentSerializer(student_obj,data = request.data,partial=True)
85 if not serializer.is_valid():
86 return Response({'status':403,'errors': serializer.errors,'message':'something went wrong'})
87
88 serializer.save()
89
90 return Response({'status':200,'payload':serializer.data,'message':'you data is updated'})
91
92 except Exception as e:
93 return Response({'status':403,'message':'invalid_id'})
94
95
96

Callers 3

likePostFunction · 0.80
updatePostFunction · 0.80
posts.jsFile · 0.80

Calls 2

StudentSerializerClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected