title: DJANGO How to do arithmetic operations in django Rest POST method
body: <p>Error: int' object has no attribute '_meta. <strong>How to do arithmetic operations in django view so a user can click on a button add to be able to add and save in the database. Thank You</strong></p>
  <p>Views.py</p>
  <pre><code>@api_view(['POST'])
  def swimmersUpdate(request, pk):
      sw = Swimmers.objects.get(id=pk)
  
      current_sessions = sw.sessions
      sw.sessions = current_sessions + 1
      
      serializer = SubSerializer(instance=current_sessions, data=request.data)
  
  
      if serializer.is_valid():
          serializer.save()
          return JsonResponse(serializer.data, safe=False, status=status.HTTP_201_CREATED)
      return JsonResponse(data=serializer.errors, safe=False, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>