title: How do I pass the users model as the ForeignKey value while saving a ModelForm in Django?
body: <p>The models file:</p>
  
  <pre><code>from django.db import models
  from django.conf import settings
  
  
  class Book(models.Model):
      rel_user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name="Posted By")
      title = models.CharField(max_length=256, verbose_name="Title")
      description = models.TextField(verbose_name="Description")
      price = models.IntegerField(verbose_name="Price")
      state = models.CharField(max_length=256, verbose_name="State")
      city = models.CharField(max_length=256, verbose_name="City")
      neighbourhood = models.CharField(max_length=256, verbose_name="Neighbourhood")
      phone = models.IntegerField(verbose_name="Phone Number")
  
      def __str__(self):
          return self.title + f" ({self.rel_user.username})"
  
  </code></pre>
  
  <p>The forms file:</p>
  
  <pre><code>from django.forms import ModelForm
  from Books.models import Book
  
  
  class BookForm(ModelForm):
      class Meta:
          model = Book
          fields = ['title', 'description', 'price', 'state', 'city', 'neighbourhood', 'phone']
  </code></pre>
  
  <p>The views file:</p>
  
  <pre><code>from django.shortcuts import render, redirect
  from Books.forms import BookForm
  from django.contrib import messages
  
  
  def sell(request):
      if request.method == "GET":
          form = BookForm()
      else:
          form = BookForm(request.POST, )
          if form.is_valid():
              form.save()
              messages.success("Successfully added!")
              return redirect('sell')
          else:
              messages.error("Please fill in all the fields.")
      return render(request, 'Books/sell.html', {"form": form})
  
  </code></pre>
  
  <p>Every time a user submits the form, I want the ForeignKey's value to be filled with that users model. How do I do this?
  So suppose user "John" has filled the form. When he clicks submit, the details he enters + his user model should go into the database for that entry.</p>