title: How to delete a single data from database in django (not deleting the entire row)
body: <p><em>To give you an understanding of my problem, I am showing my code first, then my question.</em></p>
  <p>In models.py:</p>
  <pre><code>class Post(models.Model):
      content = models.CharField(max_length=140)
      date_created = models.DateTimeField(auto_now_add=True)
      poster = models.ForeignKey(User, on_delete=models.CASCADE)
      likes = models.IntegerField(default=0)
      liked_by = models.ForeignKey(
          User, on_delete=models.CASCADE, related_name='liked_by', blank=True, null=True)
  
    
      def serialize(self):
          return {
              &quot;id&quot;: self.id,
              &quot;poster&quot;: self.poster.username,
              &quot;poster_image_url&quot;: self.poster.image_url,
              &quot;date_created&quot;: self.date_created.strftime(&quot;%b %d %Y, %I:%M %p&quot;),
              &quot;content&quot;: self.content,
              &quot;likes&quot;: self.likes,}
  </code></pre>
  <p>In views.py:</p>
  <pre><code> @csrf_exempt
      def get_post(request, post_id):
          post = Post.objects.get(pk=post_id)
          if request.method == &quot;GET&quot;:
              return JsonResponse(post.serialize())
          elif request.method == &quot;PUT&quot;:
              data = json.loads(request.body)
              if data.get('likes') is not None:
                  if data['likes'] &gt; post.likes:
                      post.likes = data['likes']
                      post.liked_by = request.user
                  else:
                      post.likes = data['likes']
                      post.liked_by.remove(request.user)
          post.save()
          return HttpResponse(status=204)
  </code></pre>
  <p>I need to remove <strong><code>request.user</code></strong> from <strong><code>liked_by</code></strong> column in the <strong><code>post</code></strong> object.
  But this error occurs:</p>
  <blockquote>
  <p>AttributeError: 'User' object has no attribute 'remove'</p>
  </blockquote>
  <p>How can I solve the problem?</p>