Example #1
0
 def post(self, request, format=None):
     serializer = ProfileSerializers(data= request.data)
     if serializer.is_valid():
         serializer.save()
         datas = serializer.data
         return Response(datas)
     return Response(serializer.errors,status=status.HTTP_400_BAD_REQUEST)
Example #2
0
 def put(self, request,pk, format=None):
     Id = self.get_object(pk)
     serializer = ProfileSerializers(Id, data = request.data)
     if serializer.is_valid():
         serializer.save()
         datas = serializer.data
         return Response(datas)
     return Response("Error", status.HTTP_400_BAD_REQUEST)
Example #3
0
 def post(self, request, format=None):
     serializer = ProfileSerializers(data=request.data)
     if serializer.is_valid():
         serializer.save()
         datas = serializer.data
         return Response(datas, status=status.HTTP_201_CREATED)