How to convert APIView to ModelViewSet
<p>I have a working Django-REST-framework <strong>APIView</strong> code. I want to rewrite that snippet to <strong>ModelViewSets</strong>.
I found some basic <a href="http://www.django-rest-framework.org/api-guide/viewsets/" rel="nofollow noreferrer">here</a>, but my input is little complicated</p>

<p>here is my input code,</p>

<pre><code>class UsualLoginClass(APIView):
    def post(self,request):
        email=request.data.get('email')
        password=request.data.get('password')
        if (UserInformation.objects.filter(emailID=email).exists() and UserInformation.objects.filter(password=password).exists()): 
            dbObject=UserInformation.objects.get(emailID=email)
            serializer = LoginSerializer(dbObject)
            userID=serializer.data.get('id')
            token=tokenGenerator(50)
            UserInformation.objects.filter(pk=userID).update(currentToken=token)                
            return  Response(data={"id":userID,"token":token})
        else:
            return Response(data={"detail":"Email and Password are not machting"})
</code></pre>

<p>Ignore my logic .</p>