title: DJANGO 'int' object has no attribute '_meta'
body: <p>I have been trying to <strong>update</strong> and <strong>add</strong> <code>+ 1</code> in the database model (sessions) field whenever a button is being <strong>clicked</strong>. I am trying to be able to add <code>+1</code> in a database field whenever a user clicks on a button and have that <code>+1</code> record and time when the button was clicked in an HTML table, Thank You All, Much Appreciate</p>
  <p><strong>Views.py</strong></p>
  <pre><code>@admin_only
  @api_view(['POST'])
  def swimmersUpdate(request, pk):
      swimmers = Swimmers.objects.get(id=pk)
      cs = swimmers.sessions
      swimmers.sessions = cs + 1
  
      serializer = SubSerializer(instance=cs, data=request.data)
  
      if serializer.is_valid():
          serializer.save()
          return Response(serializer.data, status=status.HTTP_201_CREATED)
          
      return Response(data=serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  <p><em><strong>Serializers.py</strong></em></p>
  <pre><code>class SubSerializer(serializers.ModelSerializer):
      class Meta:
          model = Swimmers
          fields ='__all__'
  </code></pre>
  <p><strong>Urls.py</strong></p>
  <pre><code>path('apiurls/', views.apiurls, name='apiurls'),
  path('swimmers-list/', views.swimmersList, name='swimmers-list'),
  path('swimmers-details/&lt;int:pk&gt;', views.swimmersDetails, name='swimmers-details'),
  path('swimmers-create/', views.swimmersCreate, name='swimmers-create'),
  path('swimmers-update/&lt;int:pk&gt;', views.swimmersUpdate, name='swimmers-update'),
  path('swimmers-delete/&lt;int:pk&gt;', views.swimmersDelete, name='swimmers-delete'),
  </code></pre>
  <p><strong>Models.py</strong></p>
  <pre><code>class Swimmers(models.Model):
      name = models.CharField(max_length=200, blank=False)
      lastname = models.CharField(max_length=200, blank=False)
      idno = models.CharField(max_length=200, blank=False, null=True)
      sessions = models.IntegerField(blank=False)
      totalsessions = models.CharField(max_length=200, blank=True )
      dateofpayment = models.CharField(max_length=200, blank=True)
      phone = models.CharField(max_length=30, blank=False, null=True)
      date_from = models.DateField(null=True)
      date_to = models.DateField(null=True)
      type_choice = (
          (&quot;basic&quot;, &quot;Basic&quot;),
          (&quot;3x1 week&quot;, &quot;3x1 Week&quot;),
          (&quot;1 session&quot;, &quot;1 Session&quot;),
          (&quot;2x1&quot;, &quot;2x1&quot;),
      )
      type = models.CharField(max_length=200, blank=False, null=True, 
          choices=type_choice, default=type_choice)
      amount = models.DecimalField(max_digits=6, decimal_places=2, blank=False, null=True)
      registration = models.DateField(default=timezone.now)
      keenphone = models.CharField(max_length=30, blank=False, null=True)
  
      def __str__(self):
          return self.name
  </code></pre>