def post(self, request): user = request.user user2 = models.User.objects.get(id=request.data['user_id']) session = serializers.SessionSerializer.create( serializers.SessionSerializer(), request.data, user, user2) serializer = serializers.SessionSerializer(session) return Response(serializer.data)
def get(self, request): session = models.Session.objects.filter( username=request.data['username']) serializer = serializers.SessionSerializer(session, many=True) return Response(serializer.data)
def get(self, request): user = request.user session = models.Session.objects.filter(candidate=user) serializer = serializers.SessionSerializer(session, many=True) return Response(serializer.data)
def get(self, request): session = models.Session.objects.get(id=request.GET['id']) serializer = serializers.SessionSerializer(session) return Response(serializer.data)
def delete(self, request): serializers.SessionSerializer.delete(serializers.SessionSerializer(), request.data) return Response("Done")
def put(self, request): session = serializers.SessionSerializer.update( serializers.SessionSerializer(), request.data) serializer = serializers.SessionSerializer(session) return Response(serializer.data)