예제 #1
0
 def create(self, request):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         msg = 'Hello {} Your Life will be settled in 2019'.format(name)
         return Response({'msg': msg})
     return Response(serializer.errors, status=400)
예제 #2
0
 def create(self, request):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         message = 'Hello' + name
         return Response({'msg': message})
     return Response(serializer.errors, status=400)
예제 #3
0
 def post(self, request):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         msg = 'Hello {} Wish You Happy New Year !!!'.format(name)
         return Response({'msg': msg})
     return Response(serializer.errors, status=400)
예제 #4
0
 def create(self, request):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         msg = 'Hello {} happy new year !!!'.format(name)
         return Response({'msg': msg})
     else:
         return Response(serializer.errors, status=400)
예제 #5
0
 def create(self, request):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         msg = "Hello {},Happy Pongal!!!".format(name)
         return Response({"msg": msg})
     else:
         return Response(serializer.errors, status=400)
예제 #6
0
 def post(self, request, *args, **kwargs):
     serializer = NameSerializer(data=request.data)
     if serializer.is_valid():
         name = serializer.data.get('name')
         msg = 'Hello {} welcome to Study Online'.format(name)
         my_dict = {'msg': msg}
         return Response(my_dict)
     else:
         return Response(serializer.errors, status=400)
예제 #7
0
    def post(self,request,*args,**kwargs):
        serializer=NameSerializer(data=request.data)
        if serializer.is_valid():
            name=serializer.data.get('name')
            msg='Hello {} Happy Holi !!!'.format(name)
            return Response({'msg':msg})

        else:
            return Response(serializer.errors,status=400)