def post(self, request, format=None): user=MyUser.objects.get(user=request.user) movie = Movie.objects.get(movieId=request.POST['movieId']) rating = Rating(ratingValue=request.POST['ratingValue'], movie=movie, user=user) rating.save() with open('data/train.csv', 'a') as csvfile: spamwriter = csv.writer(csvfile) spamwriter.writerow([user.userID, request.POST['ratingValue'], int(round(time.time(),0))]) return Response(status=status.HTTP_200_OK)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)